zsh-users
 help / color / mirror / code / Atom feed
From: Martijn Dekker <martijn@inlv.org>
To: zsh-users@zsh.org
Subject: Re: spaces in filenames should be a crime.
Date: Tue, 28 Mar 2017 20:38:59 +0200	[thread overview]
Message-ID: <72056cfd-7ded-cb6b-fb4a-52e72ce814aa@inlv.org> (raw)
In-Reply-To: <ee8d03d9-be65-9177-04e8-99fa05756257@eastlink.ca>

Op 28-03-17 om 16:29 schreef Ray Andrews:
> zsh creates the list all by itself ls or no ls.   ls is a passive
> recipient, there is no 'request'.  Yes?

Yes. And this applies to nearly[*] every command.

But 'ls' is not entirely passive. There are things that 'ls' *does* do
with the arguments it receives. It's true it doesn't resolve glob
patterns, but:

* If any of the arguments to 'ls' (after resolving glob patterns) are
directories, it will list the contents of those directories, and not
just the directories themselves, unless the '-d' option is given.

* It will provide extra information about the files if an option like
'-l' is given.

* It formats the output into columns if it finds itself writing directly
to a terminal. (To see the difference, try 'ls' and then
'ls | cat')

As always, read the manual page for more information.

HTH,

- M.

[*] One command it does *not* apply to is 'find'; it does glob pattern
matching by itself. But that does not disable the shell's glob pattern
resolver; the shell treats it like any other command. That's why you
have to tell the shell NOT to resolve those glob patterns by quoting
them, e.g.: find /some/dir -name '*.txt'


  parent reply	other threads:[~2017-03-28 18:44 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-26 20:22 Ray Andrews
2017-03-26 20:57 ` Vadim A. Misbakh-Soloviov
2017-03-26 21:18 ` Daniel Shahaf
2017-03-26 22:41   ` Ray Andrews
2017-03-26 23:20     ` Bart Schaefer
2017-03-27  0:47       ` Ray Andrews
2017-03-27  1:11         ` Chris ccb
2017-03-27  1:45           ` Ray Andrews
2017-03-27  1:44     ` Martijn Dekker
2017-03-27  2:17       ` Ray Andrews
2017-03-27 18:53         ` Jesper Nygårds
2017-03-27 23:18           ` Mikael Magnusson
2017-03-28  0:46             ` Ray Andrews
2017-03-28  9:08               ` Martin Richter
2017-03-28 14:29                 ` Ray Andrews
2017-03-28 16:10                   ` Daniel Shahaf
2017-03-28 18:01                     ` Ray Andrews
2017-03-28 18:38                   ` Martijn Dekker [this message]
     [not found]               ` <60a213ad-6cb3-bef4-9e61-f2c1611a5e71__30788.3357666016$1490694707$gmane$org@gmx.de>
2017-03-29 11:27                 ` Stephane Chazelas
2017-03-29 14:50                   ` Ray Andrews
2017-03-29 15:21                     ` Peter Stephenson
2017-03-29 16:21                       ` Ray Andrews
2017-03-30 17:36                         ` Bart Schaefer
2017-03-28 16:42           ` Matthew Martin
2017-03-26 21:24 ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=72056cfd-7ded-cb6b-fb4a-52e72ce814aa@inlv.org \
    --to=martijn@inlv.org \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).