The -d option of ls and SUS
I'm having trouble interpreting the meaning of the SUS description for the
-d option, when compared with the actual behavior and manpages for ls.
SUS says:
-d - Do not treat directories differently from other types of files.
The use of -d with -R produces unspecified results.
The ls manpage says:
-d, --directory
list directory entries instead of contents
This seems to contradict the SUS, but then an example is even more
confusing.
First an 'ls -p' (to show the directories), then an 'ls -d':
dwarf:/etc/X11# ls -p
WindowMaker/ XF86Config.test3 Xsession.options twm/
X@ XF86Config.works.xf3 Xwrapper.config wdm/
XF86Config XF86Config~ app-defaults/ xinit/
XF86Config-4 XftConfig fonts/ xkb/
XF86Config-4~ Xmodmap fs/ xserver/
XF86Config.new Xresources/ newxserver.xserver-svga xsm/
XF86Config.old Xserver rgb.txt
XF86Config.test Xsession rstart/
XF86Config.test2 Xsession.d/ temp.txt
dwarf:/etc/X11# ls -d
.
dwarf:/etc/X11#
However:
dwarf:/etc/X11# ls -d ./*
./WindowMaker ./XF86Config~ ./fs
./X ./XftConfig ./newxserver.xserver-svga
./XF86Config ./Xmodmap ./rgb.txt
./XF86Config-4 ./Xresources ./rstart
./XF86Config-4~ ./Xserver ./temp.txt
./XF86Config.new ./Xsession ./twm
./XF86Config.old ./Xsession.d ./wdm
./XF86Config.test ./Xsession.options ./xinit
./XF86Config.test2 ./Xwrapper.config ./xkb
./XF86Config.test3 ./app-defaults ./xserver
./XF86Config.works.xf3 ./fonts ./xsm
dwarf:/etc/X11#
So, what should the LSB spec say about this?
Waiting is,
Dwarf
--
_-_-_-_-_- Author of "Dwarf's Guide to Debian GNU/Linux" _-_-_-_-_-_-
_- _-
_- aka Dale Scheetz Phone: 1 (850) 656-9769 _-
_- Flexible Software 11000 McCrackin Road _-
_- e-mail: dwarf@polaris.net Tallahassee, FL 32308 _-
_- _-
_-_-_-_-_- Released under the GNU Free Documentation License _-_-_-_-
available at: http://www.polaris.net/~dwarf/
Reply to: