Advertisement
solidsnake

Max Password Entry Attempts Activity

Jan 10th, 2014
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.61 KB | None | 0 0
  1. echo -n "Enter password: "
  2. read password
  3. entryCounter=0
  4. while ([ "$password" != "lestat" ]) || ([ $entryCounter -eq 4 ])
  5. do
  6. echo -n "Enter password: "
  7. read password
  8. entryCounter=$(($entryCounter+1)) #no spaces entryCounter = $((... is wrong
  9. done
  10. if [ $entryCounter -eq 4 ]
  11. then
  12. echo "Reached max amount of entry attempts"
  13. else
  14.  
  15. echo -n "Enter ID Number: "
  16. read IDNum
  17. echo -n "Enter Last Name: "
  18. read Last
  19. echo -n "Enter First Name: "
  20. read First
  21. echo -n "Enter Middle Initial: "
  22. read Middle
  23. echo -n "Enter your age: "
  24. read age
  25.  
  26. echo "DO YOU WANT TO..."
  27. echo "1. Display Student ID, First and Last Names only"
  28. echo "2. Display all captured information"
  29. echo "3. Display terminal-related information only"
  30. echo "4. Display lucky number for today"
  31. echo "5. Enter new set of user information"
  32. echo "6. Exit"
  33. echo -n "Please enter the number of your choice: "
  34. read choice
  35. while [ $choice -ne 6 ]
  36. do
  37. case $choice in
  38. 1)
  39. echo "Student ID: $IDNum"
  40. echo "First Name: $First"
  41. echo "Last Name: $Last"
  42. echo "DO YOU WANT TO..."
  43. echo "1. Display Student ID, First and Last Names only"
  44. echo "2. Display all captured information"
  45. echo "3. Display terminal-related information only"
  46. echo "4. Display lucky number for today"
  47. echo "5. Enter new set of user information"
  48. echo "6. Exit"
  49. echo -n "Please enter the number of your choice: "
  50. read choice;;
  51. 2)
  52. echo "Student ID: $IDNum"
  53. echo "First Name: $First"
  54. echo "Middle Initial: $Middle"
  55. echo "Last Name: $Last"
  56. echo "Age: $age"
  57. echo "DO YOU WANT TO..."
  58. echo "1. Display Student ID, First and Last Names only"
  59. echo "2. Display all captured information"
  60. echo "3. Display terminal-related information only"
  61. echo "4. Display lucky number for today"
  62. echo "5. Enter new set of user information"
  63. echo "6. Exit"
  64. echo -n "Please enter the number of your choice: "
  65. read choice;;
  66. 3)
  67. echo "You are currently loged in as $USER and you current directory is `pwd`"
  68. echo "DO YOU WANT TO..."
  69. echo "1. Display Student ID, First and Last Names only"
  70. echo "2. Display all captured information"
  71. echo "3. Display terminal-related information only"
  72. echo "4. Display lucky number for today"
  73. echo "5. Enter new set of user information"
  74. echo "6. Exit"
  75. echo -n "Please enter the number of your choice: "
  76. read choice;;
  77. 4)
  78. echo "Your lucky number for today `date` is $RANDOM"
  79. echo "DO YOU WANT TO..."
  80. echo "1. Display Student ID, First and Last Names only"
  81. echo "2. Display all captured information"
  82. echo "3. Display terminal-related information only"
  83. echo "4. Display lucky number for today"
  84. echo "5. Enter new set of user information"
  85. echo "6. Exit"
  86. echo -n "Please enter the number of your choice: "
  87. read choice;;
  88. 5)
  89. echo -n "Enter ID Number: "
  90. read IDNum
  91. echo -n "Enter Last Name: "
  92. read Last
  93. echo -n "Enter First Name: "
  94. read First
  95. echo -n "Enter Middle Initial: "
  96. read Middle
  97. echo -n "Enter your age: "
  98. read age
  99. echo "DO YOU WANT TO..."
  100. echo "1. Display Student ID, First and Last Names only"
  101. echo "2. Display all captured information"
  102. echo "3. Display terminal-related information only"
  103. echo "4. Display lucky number for today"
  104. echo "5. Enter new set of user information"
  105. echo "6. Exit"
  106. echo -n "Please enter the number of your choice: "
  107. read choice;;
  108. 6) ;;
  109. *)
  110. echo -n "Please enter the number of your choice: "
  111. read choice;;
  112. esac
  113. done
  114. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement