更改for循环打印菜单逻辑
This commit is contained in:
parent
03c4d2fede
commit
f7c057fb78
6
Run.sh
6
Run.sh
@ -14,14 +14,12 @@ do
|
|||||||
|
|
||||||
pick_number=0
|
pick_number=0
|
||||||
echo "======Linux工具箱======"
|
echo "======Linux工具箱======"
|
||||||
cd Menus || exit
|
for i in "${PWD}/Menus/"*
|
||||||
for i in *
|
|
||||||
do
|
do
|
||||||
pick_number=$((pick_number + 1))
|
pick_number=$((pick_number + 1))
|
||||||
pick_array[$pick_number]=$(awk -F '.' '{print $1}' <<< "$i")
|
pick_array[$pick_number]=$(awk -F '.' '{print $1}' <<< "$(basename $i)")
|
||||||
echo "${pick_number}.${pick_array[$pick_number]}"
|
echo "${pick_number}.${pick_array[$pick_number]}"
|
||||||
done
|
done
|
||||||
cd - >> /dev/null
|
|
||||||
echo "======Linux工具箱======"
|
echo "======Linux工具箱======"
|
||||||
read -p "请输入要使用的功能:" pick
|
read -p "请输入要使用的功能:" pick
|
||||||
if [[ "${pick}" -gt 0 && "${pick}" -le "${#pick_array[*]}" ]];then
|
if [[ "${pick}" -gt 0 && "${pick}" -le "${#pick_array[*]}" ]];then
|
||||||
|
Loading…
Reference in New Issue
Block a user