A Generation Lost in the Bazaar - Poul-Henning Kamp article
Chris F.A. Johnson
chris-E7bvbYbpR6jSUeElwK9/Pw at public.gmane.org
Thu Aug 23 18:10:52 UTC 2012
On Thu, 23 Aug 2012, Lennart Sorensen wrote:
> On Wed, Aug 22, 2012 at 06:32:47PM -0400, phiscock-g851W1bGYuGnS0EtXVNi6w at public.gmane.org wrote:
>> Sure, but why do I have to add the cryptic */ to this? Why not just ls -d?
>
> Because the shell matches only directories with */ where as * matches
> everything (other than . files).
>
> ls has nothing to do with it. It just does what it is told.
>
> echo */
>
> Nice and short.
>
> ls's job is actually to count the files, run stat on them to get dates,
> permissions, etc, and format it nicely. The list itself is the shell's
> job, unless you are doing a recursive ls or not specifying any files
> and reyling on ls doing something useful based on the current working
> directory.
ls does generate the list if given a directory as an argument,
without -d.
--
Chris F.A. Johnson, <http://cfajohnson.com/>
Author:
Pro Bash Programming: Scripting the GNU/Linux Shell (2009, Apress)
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
--
The Toronto Linux Users Group. Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists
More information about the Legacy
mailing list