2. select语句控制
select var in ... ; do
$var
#!/bin/sh echo "What is your favourite firuit?" echo "1) Apple" echo "2) Orange" echo "3) Banana" read number case $number in 1)echo "your favourite firuit is Apple." ;; 2)echo "your favourite firuit is Orange." ;; 3)echo "your favourite firuit is Banana." ;; esac
#!/bin/sh echo "What is your favourite firuit?" select var in "Apple" "Orange" "Banana";do break done echo "your favourite firuit is $var."