Advertisement
Guest User

Untitled

a guest
Dec 30th, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.53 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #intialising the user credentials
  4.  
  5. echo " WELCOME!! MANIDEEP INAPAKOLLA
  6.                       `date` "
  7. echo "please enter your username :"
  8. read username
  9. echo " please enter your password : "
  10. read password
  11.  
  12. #authenticating user
  13.  
  14. if [[ " $username " == " manideep " && " $password " == " 1234 " ]]
  15. then
  16. showmenu() {
  17. echo "      
  18.            
  19.       1)Personal info
  20.       2)conatct info
  21.       3)Your current orders
  22.       4)Your previous orders
  23.       5)Exit "
  24. }
  25.  
  26. #displaying the user menu
  27.  
  28. read_options() {
  29. echo " please enter your choice : "
  30.  
  31. read a
  32.  
  33. case $a in
  34.  
  35.  
  36.      1) echo "Name :manideep
  37.             Last name : inapakolla
  38.             Address :204 w 36th street
  39.             City:Kansas
  40.             State:MO "
  41.              ;;
  42.  
  43.      2) echo " phone : 816 999999 "
  44.           ;;
  45.  3) echo "
  46.             Your current orders are
  47.             iPhone 7 and
  48.             Estimated delivery:12/31/2016 "            
  49.              ;;
  50.  
  51.      4) echo "
  52.             Your previous orders are:
  53.               apple ipad pro
  54.               apple watch series2 "
  55.                ;;
  56.  
  57.  
  58.      5) echo " See you soon
  59.               Goodbye! `date` "
  60.                exit
  61.                    ;;
  62.  
  63.       *)echo " please follow the instructions "
  64.              ;;
  65.  
  66. esac
  67. }
  68. #calling the functions declared above
  69. showmenu
  70. read_options
  71.  
  72. #displaying the menu after selecting the options
  73.  
  74. while [ "$a" -lt "5" ];do
  75. showmenu
  76. read_options
  77. done
  78. else
  79. echo " you entered incorrect password "
  80. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement