From 839d4006aa99f7682ef658231c849cba6256cb0a Mon Sep 17 00:00:00 2001 From: lsy Date: Mon, 23 Sep 2024 18:42:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AE=89=E8=A3=85=E8=BD=AF?= =?UTF-8?q?=E4=BB=B6=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Menus/Software.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Menus/Software.sh b/Menus/Software.sh index 112ba3a..79ac43b 100644 --- a/Menus/Software.sh +++ b/Menus/Software.sh @@ -44,9 +44,10 @@ for i in "${!soft_dick[@]}" ; do soft_array[$soft_number]=$i echo "${soft_number}.${i}" done +echo "请输入需要安装的软件序号(默认安装全部)" +read -p "用 空格 隔开:" pick -read -p "请输入需要安装的软件序号,用 空格 隔开:" pick - +declare i if [[ -z $pick ]];then for (( i = 1; i <= ${#soft_dick[@]}; i++ )); do if [[ $i != 1 ]]; then @@ -55,7 +56,7 @@ if [[ -z $pick ]];then pick="$i" fi done -elif [[ ! $pick =~ [1-"${#soft_dick[@]}"\ ] ]];then +elif [[ ! $pick =~ [1-$i\ ] ]];then echo "输入错误" exit fi