mirror of https://github.com/tLDP/LDP
25 lines
405 B
Bash
25 lines
405 B
Bash
#!/bin/bash
|
|
|
|
PS3='Choose your favorite vegetable: '
|
|
|
|
echo
|
|
|
|
choice_of()
|
|
{
|
|
select vegetable
|
|
# [in list] omitted, so 'select' uses arguments passed to function.
|
|
do
|
|
echo
|
|
echo "Your favorite veggie is $vegetable."
|
|
echo "Yuck!"
|
|
echo
|
|
break
|
|
done
|
|
}
|
|
|
|
choice_of beans rice carrots radishes rutabaga spinach
|
|
# $1 $2 $3 $4 $5 $6
|
|
# passed to choice_of() function
|
|
|
|
exit 0
|