ls -A

Chris Lewis clewis at ecicrl.UUCP
Mon Oct 9 06:43:30 AEST 1989


In article <1989Oct7.032907.27496 at rpi.edu> tale at pawl.rpi.edu (David C Lawrence) writes:
>In <1989Oct6.201107.9465 at eci386.uucp> jmm at eci386.uucp (John Macdonald) writes:
>John> Like all things, treating .* files specially has advantages and
>John> disadvantages.  Some form of special treatment *was* necessary -
>John> otherwise "rm *" would remove "." and ".."!
>
>No it wouldn't.   rm already does special treatment of `.' and `..'.
>Some form of special treatment by shell expansion of * wasn't
>"necessary" at all.

I think you missed the point.  If "*" expanded to include all . files,
by the principle of least surprise, then every utility would *have* to
*try* to act on "." and "..".  Eg: ed (oof!), cat (ugh!), tar (ouch!), and 
unlink (YIPES!)

Special casing "." files at command interpreter level is analogous to 
features in a lot of other operating systems.  Eg: minidisk extension 0 in 
VM/CMS (ala PROFILE EXEC A0).

I suspect that when this portion of the file system was designed, and
directory self and parent links were thought out, the idea of using
the "." prefix to *generally* hide files lit the proverbial light bulb as
a nice touch "serendipity-wise".  Almost 20 years later it still sounds
like a good idea....

Special casing "ls -A" for root is a botch though.
-- 
Chris Lewis, Elegant Communications Inc.
UUCP: {uunet!mnetor, utcsri!utzoo, uunet!attcan!lsuc, yunexus}!ecicrl!clewis
Moderator of the Ferret Mailing List (ferret-request at eci386)
Phone: (416)-294-9253



More information about the Comp.unix.wizards mailing list