Re: [PLUG] check for existing user.

Michelle Weber on 2000年1月17日 21:04:08 -0500 (EST)


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

Re: [PLUG] check for existing user.


I have it there in the condition for the while loop.
In the line above it is assigning the value true to the variable exists.
-- 
Michelle Weber
umweber@mcs.drexel.edu
On 2000年1月17日, Andrew White wrote:
> You want two "=" signs:
> 
> exists == true
> 
> -Andrew
> 
> 
> On 2000年1月17日, Michelle Weber wrote:
> 
> > 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, 
> > 
> > 
> > 
> 
> 
> ______________________________________________________________________
> 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
> 
> 
______________________________________________________________________
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 によって変換されたページ (->オリジナル) /