eternaloptimist
Well-Known Member
- Joined
- Jul 10, 2013
- Messages
- 175
- Reaction score
- 1
Hey all, bash noob here.
I have some scripts that work fine on their own. I now need to make them work from 1 file inside a loop and have the user choose which file to run.
./greet and ./shout work fine on their own i.e outside the loop.
I appreciate all the help I get, thanks.
I have some scripts that work fine on their own. I now need to make them work from 1 file inside a loop and have the user choose which file to run.
./greet and ./shout work fine on their own i.e outside the loop.
I appreciate all the help I get, thanks.
Code:
#!/bin/bash
while true; do
#how do i collect the args into an array so as to use then like $1 $2 $3 etc?
read $@
case "$*" in
a)
./greet.sh $1
;;
b)
./shout $1 $2
;;
*)
echo "bye"
exit 1
esac
done