From 5db4586f2bde6d84aac370590bbdbc94046836f2 Mon Sep 17 00:00:00 2001 From: lsy Date: Thu, 26 Sep 2024 16:03:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=BD=AF=E4=BB=B6=E7=BB=93?= =?UTF-8?q?=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Config/Docker/image.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Config/Docker/image.sh b/Config/Docker/image.sh index cc9cafb..c7c6206 100644 --- a/Config/Docker/image.sh +++ b/Config/Docker/image.sh @@ -11,17 +11,17 @@ case $pick in docker ps --format "{{.Names}}" ;; '2') - declare -a deocker_arr=($(docker ps --format "{{.Names}}")) - declare deocker_number=0 - for i in "${!docker_arr[@]}" ; do - deocker_number=$(( deocker_number+1 )) - echo "${deocker_number}.${i}" + declare -a docker_arr=($(docker ps --format "{{.Names}}")) + declare docker_number=0 + for i in "${docker_arr[@]}" ; do + docker_number=$(( docker_number+1 )) + echo "${docker_number}.${i}" done echo "要删除的镜像序号,多个镜像用 空格 隔开" read -p "请输入:" pick for i in $pick ; do - if [[ $i =~ [1-$deocker_number] ]]; then - docker rmi "${deocker_arr[$i]}" + if [[ $i =~ [1-$docker_number] ]]; then + docker rmi "${docker_arr[$i]}" fi done ;;