Problem Bug in shell builtin" test -f" or "test -e"

"Kess Peter" <[email protected]> Tue, 7 Oct 2003 14:25:41 +0200
Newsgroups gmane.comp.gnu.sh-utils.bugs
Message-ID <[email protected]>
Hello,

i have a customer where i migrate a large database from unixware to
linux( suse open enterprise 8) but it also happens in Suse 7.3 Professional.
Our customer uses "test -f" whithin thousands of scripts.

But if i use "test -f    " with no additional parameter it comes back with
exit status 0.
And I think this is not ok.

Here are some shell examples:

pknblx:/tmp # test -f
pknblx:/tmp # echo $?
0
##################################
pknblx:/tmp # test -f ANYFILE
pknblx:/tmp # echo $?
1

The same command on Sco Unixware 7.1.1:
# test -f
UX:test: FEHLER: Argument erwartet
# echo $?
1
#####################################

I have made a workaround with a shellscript "test" but I think this is not
performant.

Is there a solution?
Best regards

Peter Kess

Carl Schasiepen GmbH
Willettstr. 11
40822 Mettmann
Germany

Tel.  : +49 (2104) 494 - 231
Fax. : +49 (2104) 494 - 331

E-Mail       : mailto:[email protected]
oder
E-Mail2     : mailto:[email protected]

Internet     :  <http://www.schasiepen.de>