difference between the -o and || conditionals.
From: Dexter (dexter_at_rec-all.com)
Date: 12/01/04
- Next message: Stephane CHAZELAS: "Re: Extracting numbers from a file"
- Previous message: dfrench_at_mtxia.com: "Re: Problem With Regular Expression"
- Next in thread: dfrench_at_mtxia.com: "Re: difference between the -o and || conditionals."
- Reply: dfrench_at_mtxia.com: "Re: difference between the -o and || conditionals."
- Reply: Stephane CHAZELAS: "Re: difference between the -o and || conditionals."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 1 Dec 2004 08:42:02 -0800
Hi All,
Can someone please tell me the difference between the following constructs.
if [ $? -ne 0 ] -o [ "`cat $tmp_file | grep -i error`" ] ; then
print "error"
fi
==OR===
if [ $? -ne 0 ] || [ "`cat $tmp_file | grep -i error`" ] ; then
print "error"
fi
==OR===
if [ $? -ne 0 -o "`cat $tmp_file | grep -i error`" ] ; then
print "error"
fi
Thanks,
Dexter.
- Next message: Stephane CHAZELAS: "Re: Extracting numbers from a file"
- Previous message: dfrench_at_mtxia.com: "Re: Problem With Regular Expression"
- Next in thread: dfrench_at_mtxia.com: "Re: difference between the -o and || conditionals."
- Reply: dfrench_at_mtxia.com: "Re: difference between the -o and || conditionals."
- Reply: Stephane CHAZELAS: "Re: difference between the -o and || conditionals."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]