Results 1 to 3 of 3
Hello everybody. I'm pretty new with Linux and the bash shell. I have to make a menu and well... that part went fine. What I am having trouble with is ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 08-08-2011 #1
- Join Date
- Aug 2011
#[Ll]) ./empappL ;;
#[Ff]) ./empappF ;;
#[Cc]) ./empappC ;;
#[Ss]) ./empappS ;;
#[Qq]) ./exit ;;
Oh and also. They are in the same directory as the file that is being manipulated and the menu
while [ "$loop" = y ]
tput cup 3 12; echo "Employee Information Menu"
tput cup 4 12; echo "========================="
tput cup 6 9; echo "L - Print Last Names"
tput cup 7 9; echo "F - Print First Names"
tput cup 8 9; echo "C - Print Last Name sorted by city"
tput cup 9 9; echo "S - Print First Name, Last Name, State sorted by state"
tput cup 10 9; echo "Q - Exit the program"
read choice || continue
case $choice in
[Ll]) ./empappL ;;
[Ff]) ./empappF ;;
[Cc]) ./empappC ;;
[Ss]) ./empappS ;;
[Qq]) ./exit ;;
*) tput cup 14 4; echo "Invalid Code"; read choice ;;
- 08-10-2011 #2
Do you actually have a script called exit in this directory? If not, and you want to use bash's built-in exit function, you need to write "exit", not "./exit"."I'm just a little old lady; don't try to dazzle me with jargon!"
- 08-12-2011 #3
- Join Date
- May 2011
Are you sure the scripts being called are not running? Put a sleep after the call to each script to see the output. Or log the output to a file. Also, you can probably exit after running the scripts, b/c right now, it just loops back to the menu (unless that's what you want). e.g.:
[Ll]) ./empappL;sleep 5;exit; [Ff]) ./empappF > /tmp/empappF.log 2>&1;exit ;; [Cc]) ./empappC && echo success || echo failure;exit ;; [Ss]) ./empappS;exit ;;