Advertisement
solidsnake

CS 161 - Shellscript for Cases

Jan 6th, 2014
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. echo "Please enter Student ID"
  2. read ID
  3. echo "Please enter Last Name"
  4. read LN
  5. echo "Please enter First Name"
  6. read FN
  7. echo "Please enter Middle Initial"
  8. read MI
  9. echo "Please enter Age"
  10. read A
  11. echo "Do you want to:"
  12. echo "1. Display Student ID, First and Last name only"
  13. echo "2. Display only captured information only"
  14. echo "3. Diplay terminal-related information only"
  15. echo "4. Display lucky number for today"
  16. echo "5. Exit"
  17. echo "Please enter the number of your choice:"
  18. echo
  19. echo ...
  20. echo
  21. echo *****************
  22. read x
  23.  
  24.  
  25. case "$x" in
  26. 1) echo "-----------------------"
  27. echo "Current User's Profile"
  28. echo "-----------------------"
  29. echo "Student ID: $ID"
  30. echo "Full Name: $LN, $FN, $MI" ;;
  31. 2)
  32. echo "-----------------------"
  33. echo "Current User's Profile"
  34. echo "-----------------------"
  35. echo
  36. echo "Student ID: $ID"
  37. echo "Full Name: $LN, $FN, $MI"
  38. echo "Age: $A" ;;
  39. 3)
  40. echo "You are currently logged in as $y and your current directory is" pwd ;;
  41. 4)
  42. echo "You lucky number for today" date echo "is $r" ;;
  43. esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement