Results 1 to 2 of 2
Can anyone help me with a bash shell login script? Its for my unix class and we need to make a script that allows the users we create to login ...
- 10-01-2007 #1Just Joined!
- Join Date
- Sep 2007
- Posts
- 3
Bash shell login script
Can anyone help me with a bash shell login script? Its for my unix class and we need to make a script that allows the users we create to login on a screen and put their user name and password on it. Then from that screen it goes to a menu screen IF they put the right login/password combination.
Heres what i have so far.
But none of it seems to work.Code:tput cup $1 $2 tput clear bold=`tput smso` offbold=`tput rmso` echo $bold tput cup 10 20; echo "User ID:" tput cup 12 20; echo "Password:" echo $offbold tput cup 10 41; read userid tput cup 12 41; read password while [ "$userid" != "/etc/passwd" ]; do echo $bold tput cup 15 35; echo "Incorrect User/Password" echo $offbold if [ "$userid" = "/etc/passwd" ]; then clear ./companymenu; fi done
I'm stumped on what to do about letting it read a file with the users and password on it. Please help me.
- 10-02-2007 #2
You can use bash's read command to read a line from standard input. Put it in a loop. Then, for that loop, redirect input from the file you want to read.
For more information on the read command, enter the following at the command line:
Hope this helps.Code:help read


Reply With Quote