|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
|
Re: [PLUG] check for existing user
|
That was my first thought, but then grep returns the lines which that
appears, and what if it is in another field besides the first field? (Like
name or something) - (ok i answered my own question, use a regexp, but im
trying to make this really simple! and I kinda forget how to do regexps
anyway...)
I was thinking of just using the command id, but for either grep or id,
how do I make a variable equal to true or false depending on what grep or
another command returns? (in bash)
--
Michelle Weber
umweber@mcs.drexel.edu
On Sun, 16 Jan 2000, Bill Jonas wrote:
> > What would be the easiest way to check for an existing user with a shell
> > script? So that if it does exist i can do one thing, and if it doesn't i
> > can do another?
>
> Grep the /etc/passwd file? Does grep give a return value?
>
> Bill
>
> --
> "Because they know that all they sold you was a guaranteed POS! Look, if
> you want me to take a dump in a box and mark it 'guaranteed', I will. I got
> spare time."
> -Chris Farley (on Microsoft?), _Tommy Boy_
>
>
>
>
>
> ______________________________________________________________________
> 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
|
|