Debian Codegraph @

ex32.sh

raw symbols SCIP
1 #!/bin/bash
2
3 PS3='Choose your favorite vegetable: '
4
5 echo
6
7 choice_of()
8 {
9 select vegetable
10 # [in list] omitted, so 'select' uses arguments passed to function.
11 do
12 echo
13 echo "Your favorite veggie is $vegetable."
14 echo "Yuck!"
15 echo
16 break
17 done
18 }
19
20 choice_of beans rice carrots radishes rutabaga spinach
21 # $1 $2 $3 $4 $5 $6
22 # passed to choice_of() function
23
24 exit 0