Michelle Weber on Sun, 16 Jan 2000 10:47:27 -0500 (EST)


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

Re: [PLUG] check for existing user


What does the 1>&2 mean in that?

-- 
Michelle Weber
umweber@mcs.drexel.edu


On Sun, 16 Jan 2000, Tim Peeler wrote:

> On Sun, 16 Jan 2000, you wrote:
> 
> > 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
> 
> Just use an if statement.
> 
> if (grep regexp foo 1>&2 > /dev/null) ; then
>    var=true;
> else
>    var=false;
> fi
> 
> Don't know if bash has something like c's conditional statements:
> 
> (grep regexp foo 1>&2>/dev/null) ? var=true : var=false;
> 
> But you could check.
> 
> ______________________________________________________________________
> 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