Ronan
Auditioning
- Joined
- Jul 5, 2001
- Messages
- 6
part of my assignment is, to write a script 'C shell' to accept any user ID. containing the any of the following characters ' y r e w q s ' in any position of the user ID.
So far I have the easy part done.
Now I need to search the user's ID for one of the characters above and if it contains one accept the ID.
prempt:
onintr interrupt
echo "Welcome to the UNIX O/S."
set password = y
echo -n "Enter your password: "
set code = `head -1`
while ("$password" != "$code")
echo "Wrong password."
echo -n "Enter your password again: "
set code = `head -1`
end
echo "correct password"
exit 0
interrupt:
echo "Do not try to terminate by pressing ^c!"
goto prempt
If anyone is able to sugest a solution I would be very greatful.
So far I have the easy part done.
Now I need to search the user's ID for one of the characters above and if it contains one accept the ID.
prempt:
onintr interrupt
echo "Welcome to the UNIX O/S."
set password = y
echo -n "Enter your password: "
set code = `head -1`
while ("$password" != "$code")
echo "Wrong password."
echo -n "Enter your password again: "
set code = `head -1`
end
echo "correct password"
exit 0
interrupt:
echo "Do not try to terminate by pressing ^c!"
goto prempt
If anyone is able to sugest a solution I would be very greatful.