Question about 'test' (Was Re: testing if a file is present)

q.p.liu qpliu at phoenix.princeton.edu
Fri Nov 30 12:53:47 AEST 1990


In article <4586 at auspex.auspex.com> guy at auspex.auspex.com (Guy Harris) writes:
 >>But what will the (bourne-) shell say about...
 >>>
 >>>        If [ -r filename ]; then

 >"test"/"[" will then say "well, I was invoked as '[' rather than 'test';
 >that means I should check to make sure my last argument is ']', and
 >complain otherwise."

trying /bin/[ shows that it only checks if argv[0] == "[".



More information about the Comp.unix.shell mailing list