Henry E. Thorpe writes:
 > I don't know if you noticed-- the one that returned '1' was where I
 > removed the last character from the file name.

Nope, missed that.  D'oh.

 > Curious.  It looks like the /bin/test is just a shell script using
 > the ksh built-in.  Note that /usr/bin is just a link to /bin, so
 > this applies to both directories.  Also, it look like this isn't
 > ksh '93:

Yes, /bin/test does invoke the test builtin of a ksh subshell.  The
files such as [/usr]/bin/test are there to meet the letter of
POSIX/UNIX requirements.

Normal use of "test" in a Bourne style shell will pick up the builtin.
You missed out on the "type" builtin.  "which" and "whereis" are
external commands which cannot know about builtins.

E.g. Solaris /usr/bin/ksh:

$ type test
test is a shell builtin

$ type /usr/bin/test
/usr/bin/test is /usr/bin/test


 > > Henry E. Thorpe writes:
 > >  > The test in the 1.409 version of tramp seems to assume that
 > >  > "test -e filename/" will return a non-zero value if filename
 > >  > is not a directory.  Unfortunately, it doesn't on Solaris 2.6:

I think I also missed your original point.  "test -e" checks whether a
file exists.  The file may be regular, dir, symlink or whatever.  The
filename tested may have been expanded by the shell and will be
interpreted by the OS.  The rules for the latter vary.

The treatment of a trailing slash on a filename is currently
unspecified by standards.  Some systems ignore the trailing slash
(e.g. Solaris), others (e.g. Linux) permit it only if it refers to an
existing directory.

The next revision of POSIX and UNIX will mandate the latter.  A
trailing slash will be interpreted as if a dot were appended.  The
current situation is that portable applications cannot rely on the
treatment of trailing slashes.

If tramp is testing for a directory using "<sometest> filename/", that
should be altered to "<sometest> filename/.".  If it is testing for a
file of any variety the check should be "<sometest> filename".
-- 
Pete Forman                 -./\.- Disclaimer: This post is originated
Western Geophysical           -./\.-  by myself and does not represent
[EMAIL PROTECTED]         -./\.-  the opinion of Baker Hughes or
http://www.crosswinds.net/~petef  -./\.-  its divisions.

Reply via email to