Skip to content

Commit

Permalink
cleaned up some
Browse files Browse the repository at this point in the history
  • Loading branch information
Randall-Mcgoy committed Oct 9, 2018
1 parent 9f594a3 commit 6df6dc3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 30 deletions.
29 changes: 14 additions & 15 deletions functest
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,33 @@
#random test of functions global and local variables

function func1 () {
echo "func1"
local loc="This is loc from func1"
glob="This is glob from func1"
echo $glob
echo $loc
echo "func1"
local loc="This is loc from func1"
glob="This is glob from func1"
echo $glob
echo $loc
}

function func2 () {
echo "func2"
echo $glob
echo $loc
echo "func2"
echo $glob
echo $loc
}

function func3 () {
echo "fun3"
echo $glob
echo $loc
echo "fun3"
echo $glob
echo $loc
}

function func4 () {
echo "func4"
echo $glob
echo $loc
echo "func4"
echo $glob
echo $loc
}


#Main prog

func1
func2
func3
Expand Down
9 changes: 0 additions & 9 deletions saveoutput

This file was deleted.

15 changes: 9 additions & 6 deletions select_test
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

0 comments on commit 6df6dc3

Please sign in to comment.