修复软件安装正则问题
This commit is contained in:
parent
b196fdacee
commit
99a1ea54a1
@ -47,7 +47,6 @@ done
|
|||||||
echo "请输入需要安装的软件序号(默认安装全部)"
|
echo "请输入需要安装的软件序号(默认安装全部)"
|
||||||
read -p "用 空格 隔开:" pick
|
read -p "用 空格 隔开:" pick
|
||||||
|
|
||||||
|
|
||||||
if [[ -z $pick ]];then
|
if [[ -z $pick ]];then
|
||||||
for (( i = 1; i <= ${#soft_dick[@]}; i++ )); do
|
for (( i = 1; i <= ${#soft_dick[@]}; i++ )); do
|
||||||
if [[ $i != 1 ]]; then
|
if [[ $i != 1 ]]; then
|
||||||
@ -56,14 +55,10 @@ if [[ -z $pick ]];then
|
|||||||
pick="$i"
|
pick="$i"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
else
|
elif ! [[ $pick =~ [1-${#soft_dick[@]}] || $pick =~ ([1-${#soft_dick[@]}][\s]?)+ ]];then
|
||||||
for i in $pick ; do
|
|
||||||
if [[ ! $i =~ [1-$soft_number] ]]; then
|
|
||||||
echo "输入错误"
|
echo "输入错误"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
for i in $pick ; do
|
for i in $pick ; do
|
||||||
if [[ ${soft_dick[${soft_array[$i]}]} == 0 ]]; then
|
if [[ ${soft_dick[${soft_array[$i]}]} == 0 ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user