Yes, but several Unix systems supply an old style Bourne SH as well as a
POSIX shell (essentially ksh scaled down) and ksh. KSH implemented the [[
as a way of internalizing the condition.
For the most part, the syntax will work in most Bourne derived shells.
if [ <condition> ]
then
# true stuff
fi
If the [ is internalized, then the script will perform better.
On 22 Apr 2002 at 10:14, Steven W. Orr wrote:
> Just to muddy the waters even further...
> Bourne shell under Linux is actually a link to bash. Both the [ operator
> and the test command are both builtins to both Bourne and bash. The [[
> operator is actually different from a builtin; it is considered a keyword.
> It also has different syntax in that certain operators are not legal and
> vice versa. If you ever really and truly ever want to run the binary test
> (though I have no idea why you would), you have to explicity invoke it via
> pathname. e.g.,
>
> if /usr/bin/test "${x}" -eq 44
> then
> echo walla
> fi
>
> --
> -Time flies like the wind. Fruit flies like a banana. Stranger things have -
> -happened but none stranger than this. Does your driver's license say Organ
> -Donor?Black holes are where God divided by zero. Listen to me! We are all-
> -individuals! What if this weren't a hypothetical question? [EMAIL PROTECTED]
>
>
>
> *****************************************************************
> To unsubscribe from this list, send mail to [EMAIL PROTECTED]
> with the text 'unsubscribe gnhlug' in the message body.
> *****************************************************************
--
Jerry Feldman <[EMAIL PROTECTED]>
Associate Director
Boston Linux and Unix user group
http://www.blu.org PGP key id:C5061EA9
PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9
*****************************************************************
To unsubscribe from this list, send mail to [EMAIL PROTECTED]
with the text 'unsubscribe gnhlug' in the message body.
*****************************************************************