试图在有系统安装的含水层机器上写一个简单的文字,以显示使用 whi尾阵列的时间区清单。 至今:
tzones=$(timedatectl list-timezones)
arr=( $tzones )
count=0
for i in "${arr[@]}"; do allzones[$count]=$(echo ""$i""); ((count=count+1)); done
for i in "${allzones[@]}"; do echo $i; done #So I know I have a list of items in quotes at this point
whiptail --title "Time zone" --menu "Select time zone" 25 78 16 "${allzones[@]}"
Bash keeps spitting out a help menu for whiptail. I ve only just started messing with whiptail and I ve been at this script a while so not sure what I m missing.