posix me harder

David Collier-Brown davecb at canada.sun.com
Fri Mar 15 00:11:45 EST 2002


Martin Pool wrote:
> is that Sun's test(1) is breathtakingly broken when passed 
> a dangling symlink:
> 
> $ ln -s /nowhere bad
> $ ls -l bad
> lrwxrwxrwx   1 josb     user            8 Mar 13 20:10 bad -> /nowhere
> $ if test -L bad; then echo bad; fi
> test: argument expected
> $ if test -h bad; then echo bad; fi
> bad


	Fixed, in Solaris 8, but broken in
	at least 2.6 and possibly 7.

elsbeth> ln -s /nowhere bad
you have mail in /var/mail/davecb
elsbeth> ls -l bad
lrwxrwxrwx   1 davecb   staff          8 Mar 14  2002 bad -> /nowhere
elsbeth> if test -L bad; then echo bad; fi
bad
elsbeth> if test -h bad; then echo bad; fi
bad

--dave
-- 
David Collier-Brown,           | Always do right. This will gratify 
Performance & Engineering      | some people and astonish the rest.
Americas Customer Engineering, |                      -- Mark Twain
(905) 415-2849                 | davecb at canada.sun.com




More information about the rsync mailing list