running test

--------------------------------------------------------------------------------

I am running a test command and if the user is not found you have to type exit and it wiil exit. Ok I did that. But if the user is found it is supposed to finger them. But my problem is it makes you type exit first then it fingers them. Why? whats wrong?

if [ -z username ]
then
error_fn
else
echo "Please try again or type exit to quit"
read exit"
if grep "$username" /etc/passwd
then
finger "$username"
fi
fi

I must have something switched around huh?

There are two different threads with basically exactly this question. Use the search facility in these forums, and read the forum rules -- using the forums to get your homework done for you is strongly discouraged.

Double post, thread closed.

Continu here: