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

Jonathan I. Kamens jik at athena.mit.edu
Mon Dec 3 08:01:41 AEST 1990


In article <QPLIU.90Nov29205347 at phoenix.princeton.edu>, qpliu at phoenix.princeton.edu (q.p.liu) writes:
|> In article <4586 at auspex.auspex.com> guy at auspex.auspex.com (Guy Harris) writes:
|>  >"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] == "[".

  Then either you did something wrong, or you're using a buggy version of
"test."

	$ [ frep
	test: ] missing
	$ echo $?
	255
	$ [ frep ]
	$ echo $?
	0

-- 
Jonathan Kamens			              USnail:
MIT Project Athena				11 Ashford Terrace
jik at Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-8085			      Home: 617-782-0710



More information about the Comp.unix.shell mailing list