I am new to shell scripting and doing a similar thing @ work
Stan:Smith
etroit:MI
Jim:Jones:Farmington Hills:MI
Jack:Frost
enver:CO
Sue:Apple:New York:NY
Cindy:Thompson:Battle Creek:MI
John:Smith
enver:CO
George:Jones:New York:NY
Need to create a shell script This script will display the following information in a menu format:
L - Print Last Names
F - Print First Names
C - Print First Name, Last Name sorted by city
S - Print First Name, Last Name, State sorted by state
Q - Exit the program
The script will perform all of the actions listed above on your file and loop until Q key is pressed.
I did the below but not working...
Code:
loop=y
while [ "$loop" = y ]
do
clear
tput cup 3 12; echo "P - Print Last Name"
tput cup 10 9; echo "Q - Quit: "
tput cup 10 19;
read choice || continue
case $choice in
[Pp]) less ~/export/home/mathews/homework2;;
[Qq]) exit ;;
*) tput cup 14 4; echo "Invalid Code"; read choice ;;
esac
done
Please help