[PLUG] check for existing user.

Michelle Weber on 2000年1月17日 19:55:03 -0500 (EST)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[PLUG] check for existing user.


Can someone tell me the obvious and what is wrong with this loop in bash:
exists=true
while [ exists==true ];
do
 echo "Username: "
 read username
 
 if (grep ^$username: /etc/passwd 1>&2 > /dev/null) ; then
 exists=true
 else 
 exists=false
 fi; 
done 
No matter what it seems exists=true because the loop never exits.
Thanks, 
-- 
Michelle Weber
umweber@mcs.drexel.edu
______________________________________________________________________
Philadelphia Linux Users Group - http://plug.nothinbut.net
Announcements - http://lists.nothinbut.net/mail/listinfo/plug-announce
General Discussion - http://lists.nothinbut.net/mail/listinfo/plug



AltStyle によって変換されたページ (->オリジナル) /