Ksh test difference?

Steve Simmons scs at itivax.iti.org
Wed Dec 13 02:23:48 AEST 1989


I've recently observed a difference between ksh and sh.  The ksh is the
one on the UNIX-PC.  The following script works correctly with all bourne
shells I've found, but fails on that ksh:

if [ -w foo -r foo ] ; then
	echo file foo is readable and writable
else
	echo file foo is not readable and writable
fi

On ksh I get a syntax error.  Changing the first line to
	if [ -w foo -a -r foo ] ; then
causes it to work correctly on all systems.
-- 
Steve Simmons	       scs at iti.org         Industrial Technology Institute
	'"You're not a big name on Usenet until someone puts
	  you in their .sig file."		-- Anonymous'



More information about the Comp.unix.wizards mailing list