-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Randall-Mcgoy
committed
Oct 9, 2018
1 parent
9f594a3
commit 6df6dc3
Showing
3 changed files
with
23 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
#!/bin/bash | ||
#tests select control flow | ||
|
||
juices=(orange papaya apple orange grape pineapple) | ||
trap 'echo Holy moly you pressed interrupt' SIGINT SIGTERM SIGSTOP | ||
script=$(basename $0) | ||
|
||
PS3="Please choose a juice that you like " | ||
select juice in ${juices[*]} | ||
|
||
fruit=(orange papaya apple orange grape pineapple) | ||
trap "echo $script interrupted; exit 1" 1 2 3 19 20 | ||
|
||
PS3="Please choose a fruit that you like " | ||
select fruit in ${fruit[*]} | ||
do | ||
if [ juice ]; then | ||
echo "Here is your $juice juice" | ||
if [ fruit ]; then | ||
echo "Here is your $fruit" | ||
fi | ||
break | ||
done |