basically Im stuck at what i believe is something really simple but i just dont ahve a clue how to do it efficiently and properly and i REALLY appreciate some help
Basically i have a loop at which someone has to enter a string of 3 numbers,
I want the code to check that the string is numbers only, check that the numbers have not been already signed to someone else in the users.db file and to restrict the number of numbers to only 3.
and each time the user inputs the number wrong i want it to be allowed to correct and tell why he has to re enter it.
This is the best i could came up with but IM REALLY suck and im at a short UNIX course (1 week) for a job....
Can anyone please tell how do i make the loop properly??
this is the best i could came up with... and i KNOW is crap... but i just dont know best........ I would really appreciate some guidance plz
while acceptable = N
echo "enter user id \c"
if $user passes numeric tests
if acceptable = Y
grep $user user.db
if $? = ???????
echo $user >>user.db
echo $user is acceptable, and added to userdb