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

Re: Bash commands



On 2002-09-01 00:52:19, Allan Wind wrote:
> On 2002-09-01 14:25:53, Russell wrote:
> > 
> >   debpc:# if [ -n df /mnt | grep -ie "/dev/hdc1" ] ; then echo "yes" ; fi
> 
> You need the put 'df ..' in back quotes (``) to get it executed,
> but usually the exist status ($?) of grep is used to do this:
> 
> df /mnt | grep -ie /dev/hdc1 > /dev/null; if [ $? -nq 0 ]; then echo "yes"; fi

Sorry, -nq should have been -eq in the above.


/Allan
-- 
Allan Wind
P.O. Box 2022
Woburn, MA 01888-0022
USA

Attachment: pgpOJ6Jbfrn_H.pgp
Description: PGP signature


Reply to: