p { margin-bottom: 0.08in; } As you can already tell I am a newbie. I took a Microsoft VB2008 a few month back. Now I'm taking Linux + and this course requires me to write scripts. The script executes but, I can't figure out or have not found anything that I can make out on the internet that can answer my questions.
1 I need to make this two statements: if [ "$user_ID" = jcs ] && [ "$password" = 123456 ]
2 If they enter anything other than y they should get message Goodbye
3 Any comments would be appreciated.
4 I would like to add a counter
#!/bin/bash
# Date: 09/25/2011
# Purpose: Authenticate
# Creator: JCS
# Lasted Changed: 09/25/2011
clear
echo -n -e "\n\n\nPlease enter you ID: "
read user_ID
clear
echo -n -e "\n\n\nPlease enter your password "
read password
clear
*****if [ "$user_ID" = jcs ] && [ "$password" = 123456 ]; then
echo -e "\n\n\nYou have been authenticated."
else
echo -n -e "\n\n\nThere is a problem with your authentication. Would you like to try again, enter y for yes."
read answer
fi
while [ "$answer" = y ];
do
echo -e "\n\n\nPlease enter you ID: "
read user_ID
clear
echo -e "Please enter your password "
read password
clear
if [ "$user_ID" = jcs ] && [ "$password" = 123456 ]; then
echo -e "You have been authenticated."
else
***echo -e "There is a problem with your authentication. Would you like to try again. Enter y for yes"
read entry
fi
done