Andrew White on Mon, 17 Jan 2000 20:49:31 -0500 (EST)


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

Re: [PLUG] check for existing user.


You want two "=" signs:

  exists == true

-Andrew


On Mon, 17 Jan 2000, 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