Subject: Re: test: syntax error in +DEINSTALL using test -ef
To: None <tech-pkg@NetBSD.org>
From: Johnny C. Lam <jlam@NetBSD.org>
List: tech-pkg
Date: 10/04/2003 09:23:56
On Sat, Oct 04, 2003 at 12:15:26AM -0700, Jeremy C. Reed wrote:
> Revision 1.22 of mk/install/deinstall includes:
> 
> -                       if [ "${file}" != "${samplefile}" -a            \
> +                       if [ ! "${file}" -ef "${samplefile}" -a         \
> 
> Under BSD/OS, this causes:
> 
> + shift
> + [ ! /usr/pkg/etc/openssl/openssl.cnf -ef
> /usr/pkg/share/examples/openssl/openssl.cnf -a -e
> /usr/pkg/etc/openssl/openssl.cnf -a -e
> /usr/pkg/share/examples/openssl/openssl.cnf ]
> test: syntax error
> + [ 0 -gt 0 ]
> 
> 
> So test's -ef means FILE1 and FILE2 have the same device and inode
> numbers. But this doesn't exist with test provided by BSD/OS. sh doesn't
> provide built-in test. The BASH version of test does support -ef.
> 
> 
> $ sh
> $ test /bin/ls -ef /bin/ls
> test: syntax error
> $ /bin/test /bin/ls -ef /bin/ls
> test: syntax error
> 
> Is -ef supposed to be standard (POSIX?) with test and sh?

Does BSD/OS have a /bin/ksh?  If so, then we can set SH=/bin/ksh on
BSD/OS and the Korn shell test builtin will support -ef.

	Cheers,

	-- Johnny Lam <jlam@NetBSD.org>