From 99a1ea54a188f5ffeec95f08fd0a8950d108f7a1 Mon Sep 17 00:00:00 2001 From: lsy Date: Mon, 23 Sep 2024 20:32:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=BD=AF=E4=BB=B6=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E6=AD=A3=E5=88=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Menus/Software.sh | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Menus/Software.sh b/Menus/Software.sh index 2a10e13..df52e54 100644 --- a/Menus/Software.sh +++ b/Menus/Software.sh @@ -47,7 +47,6 @@ done echo "请输入需要安装的软件序号(默认安装全部)" read -p "用 空格 隔开:" pick - if [[ -z $pick ]];then for (( i = 1; i <= ${#soft_dick[@]}; i++ )); do if [[ $i != 1 ]]; then @@ -56,13 +55,9 @@ if [[ -z $pick ]];then pick="$i" fi done -else - for i in $pick ; do - if [[ ! $i =~ [1-$soft_number] ]]; then - echo "输入错误" - exit - fi - done +elif ! [[ $pick =~ [1-${#soft_dick[@]}] || $pick =~ ([1-${#soft_dick[@]}][\s]?)+ ]];then + echo "输入错误" + exit fi for i in $pick ; do