Subject: Re: Linux emulation and mkdir with trailing /
To: None <tech-kern@netbsd.org>
From: Wolfgang Solfrank <ws@tools.de>
List: tech-kern
Date: 09/26/2000 13:49:52
Hi,

> OK, so to stray a bit more off-topic, why does SunOS-5.6, apparently in
> conformance with both 1003.2-1992 and 1003.1-1988, do this?
> 
> 	17:13 [154] $ ls -l /usr/bin/sh
> 	-r-xr-xr-x   2 bin      root       88620 Jul 16  1997 /usr/bin/sh
> 	17:18 [155] $ ls -l /usr/bin/sh/                                   
> 	-r-xr-xr-x   2 bin      root       88620 Jul 16  1997 /usr/bin/sh/
> 	17:18 [156] $ sh
> 	$ ls -l /usr/bin/sh
> 	-r-xr-xr-x   2 bin      root       88620 Jul 16  1997 /usr/bin/sh
> 	$ ls -l /usr/bin/sh/
> 	-r-xr-xr-x   2 bin      root       88620 Jul 16  1997 /usr/bin/sh/
> 	17:19 [157] $ $                                                      
> 	17:19 [157] $ csh
> 	% ls -l /usr/bin/sh
> 	-r-xr-xr-x   2 bin      root       88620 Jul 16  1997 /usr/bin/sh
> 	% ls -l /usr/bin/sh/
> 	-r-xr-xr-x   2 bin      root       88620 Jul 16  1997 /usr/bin/sh/

Looks like it's even inconsistently implemented in the shell(s) (this is
with SunOS-5.8 however).  sh results in:

	$ ls -l /usr/bin/sh/
	-r-xr-xr-x   4 root     root       95308 Jan  6  2000 /usr/bin/sh/
	$ ls -l /usr/bin/*/
	/usr/bin/*/: No such file or directory
	$

which is totally nonobvious (at least to me). However with csh and ksh,
you get:

	% ls -l /usr/bin/sh/
	-r-xr-xr-x   4 root     root       95308 Jan  6  2000 /usr/bin/sh/
	% ls -l /usr/bin/*/
	lrwxrwxrwx   1 root     root          17 Jul 23 16:48 /usr/bin/prodregdir/ -> ../lib/prodregdir

	/usr/bin/sparcv7/:
	total 1934
	-r-xr-xr-x   1 root     bin       130796 Jan  6  2000 adb
	...
	-r-sr-xr-x   2 root     bin        11368 Jan  6  2000 w

	/usr/bin/sparcv9/:
	total 2612
	-r-xr-xr-x   1 root     bin       191232 Jan  6  2000 adb
	...
	-r-sr-xr-x   2 root     bin        15392 Jan  6  2000 w

i.e. a listing of the subdirectories of /usr/bin

Ciao,
Wolfgang
-- 
ws@TooLs.DE     Wolfgang Solfrank, TooLs GmbH 	+49-228-985800