Question about 'test'

q.p.liu qpliu at phoenix.princeton.edu
Sat Dec 1 12:27:35 AEST 1990


In article <1779 at seti.inria.fr>
deschamp at minos.inria.fr (Philippe Deschamp) writes:
>In article <QPLIU.90Nov29205347 at phoenix.princeton.edu>,
>qpliu at phoenix.princeton.edu (q.p.liu) writes:
>|> trying /bin/[ shows that it only checks if argv[0] == "[".
>   *Never* generalize :-). On my workstation (Sun 3/60 under SunOS 4.0.3):

(Ok, was on sunos 4.1, 4.0.3 (sun4) and ctss (cray xmp, cray 2) running sh)

(btw, the string comparision is as in awk, not as in C)

>What I do not understand is this:
>	$ /bin/[
>	$
>
>Why no complaint in the last case ?

In this case, argv[0] != "[", hence no check for ].



More information about the Comp.unix.shell mailing list