zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Ray Andrews <rayandrews@eastlink.ca>
Cc: zsh-users@zsh.org
Subject: Re: ls *.mp4 → ls : invalid option -- 'M'
Date: Mon, 16 Oct 2023 11:21:36 -0700	[thread overview]
Message-ID: <CAH+w=7ac5eg6HbpX=+OyZ+zn9vPjHarGYujnHVdbbOo1pT7g0A@mail.gmail.com> (raw)
In-Reply-To: <179314f9-333c-4baa-9dab-6fa397ab2f64@eastlink.ca>

On Mon, Oct 16, 2023 at 6:35 AM Ray Andrews <rayandrews@eastlink.ca> wrote:
>
> Question:  is this not the sort of issue that in principle cannot be solved in an air-tight way?

It is in the same category as filenames containing newlines and
assorted globbing characters in that it mostly comes up in contexts
where the user doesn't see the string before it's processed.  However,
it's a little more insidious because other "unusual" characters can be
handled with appropriate quoting, and globbing is the most likely
place for leading hyphens to crop up because globbing is more common
in interactive use than things like "find | xargs".

>  If shells always expand arguments zealously

I'm not sure that's the right characterization, but anyway ...

> with the presumption that they are filenames

Only true of globbing.

> if someone has filenames that mimic de facto options when globbing is done, are they not a victim of their own liberty?

They might be a "victim" of file sharing from a different operating system.


  reply	other threads:[~2023-10-16 18:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-13  7:59 Denis Bitouzé
2023-10-13  8:15 ` sergio
2023-10-13  8:15 ` Mikael Magnusson
2023-10-13 11:38   ` Denis Bitouzé
2023-10-13 14:46   ` Ray Andrews
2023-10-13 15:13     ` Peter Stephenson
2023-10-13 15:58       ` Ray Andrews
2023-10-16  0:46       ` Bart Schaefer
2023-10-16  4:17         ` Bart Schaefer
2023-10-16  4:25           ` Bart Schaefer
2023-10-16 13:35             ` Ray Andrews
2023-10-16 18:21               ` Bart Schaefer [this message]
2023-10-16 19:45                 ` Ray Andrews
2023-10-17  3:49                   ` Bart Schaefer
2023-10-17 14:04                     ` Ray Andrews
2023-10-17 15:55                       ` Bart Schaefer
2023-10-17 17:03                         ` Ray Andrews

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='CAH+w=7ac5eg6HbpX=+OyZ+zn9vPjHarGYujnHVdbbOo1pT7g0A@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=rayandrews@eastlink.ca \
    --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).