Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- echo -n "Enter password: "
- read password
- entryCounter=0
- while ([ "$password" != "lestat" ]) && ([ $entryCounter -lt 4 ])
- do
- echo
- echo "---INCORRECT password---"
- echo
- echo "$((4-$entryCounter)) attempt(s) remaining"
- echo
- echo -n "Enter NEW password: "
- read password
- entryCounter=$(($entryCounter+1)) #no spaces entryCounter = $((... is wrong
- done
- if [ $entryCounter -eq 4 ]
- then
- echo "Reached max amount of entry attempts. Exiting..."
- else
- echo -n "Enter ID Number: "
- read IDNum
- echo -n "Enter Last Name: "
- read Last
- echo -n "Enter First Name: "
- read First
- echo -n "Enter Middle Initial: "
- read Middle
- echo -n "Enter Age: "
- read age
- echo
- echo "DO YOU WANT TO..."
- echo "1. Display Student ID, First and Last Names only"
- echo "2. Display all captured information"
- echo "3. Display terminal-related information only"
- echo "4. Display lucky number for today"
- echo "5. Enter new set of user information"
- echo "6. Exit"
- echo -n "Please enter the number of your choice: "
- read choice
- while [ $choice -ne 6 ]
- do
- case $choice in
- 1)
- echo "Student ID: $IDNum"
- echo "First Name: $First"
- echo "Last Name: $Last"
- echo
- echo "DO YOU WANT TO..."
- echo "1. Display Student ID, First and Last Names only"
- echo "2. Display all captured information"
- echo "3. Display terminal-related information only"
- echo "4. Display lucky number for today"
- echo "5. Enter new set of user information"
- echo "6. Exit"
- echo -n "Please enter the number of your choice: "
- read choice;;
- 2)
- echo "Student ID: $IDNum"
- echo "First Name: $First"
- echo "Middle Initial: $Middle"
- echo "Last Name: $Last"
- echo "Age: $age"
- echo
- echo "DO YOU WANT TO..."
- echo "1. Display Student ID, First and Last Names only"
- echo "2. Display all captured information"
- echo "3. Display terminal-related information only"
- echo "4. Display lucky number for today"
- echo "5. Enter new set of user information"
- echo "6. Exit"
- echo -n "Please enter the number of your choice: "
- read choice;;
- 3)
- echo "You are currently logged in as $USER and you current directory is `pwd`"
- echo
- echo "DO YOU WANT TO..."
- echo "1. Display Student ID, First and Last Names only"
- echo "2. Display all captured information"
- echo "3. Display terminal-related information only"
- echo "4. Display lucky number for today"
- echo "5. Enter new set of user information"
- echo "6. Exit"
- echo -n "Please enter the number of your choice: "
- read choice;;
- 4)
- echo "Your lucky number for today `date` is $RANDOM"
- echo
- echo "DO YOU WANT TO..."
- echo "1. Display Student ID, First and Last Names only"
- echo "2. Display all captured information"
- echo "3. Display terminal-related information only"
- echo "4. Display lucky number for today"
- echo "5. Enter new set of user information"
- echo "6. Exit"
- echo -n "Please enter the number of your choice: "
- read choice;;
- 5)
- echo -n "Enter ID Number: "
- read IDNum
- echo -n "Enter Last Name: "
- read Last
- echo -n "Enter First Name: "
- read First
- echo -n "Enter Middle Initial: "
- read Middle
- echo -n "Enter your age: "
- read age
- echo
- echo "DO YOU WANT TO..."
- echo "1. Display Student ID, First and Last Names only"
- echo "2. Display all captured information"
- echo "3. Display terminal-related information only"
- echo "4. Display lucky number for today"
- echo "5. Enter new set of user information"
- echo "6. Exit"
- echo -n "Please enter the number of your choice: "
- read choice;;
- 6) ;;
- *)
- echo -n "Please enter the number of your choice: "
- read choice;;
- esac
- done
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement