Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: ls *.mp4 → ls : invalid option -- 'M'



On Mon, Oct 16, 2023 at 6:35 AM Ray Andrews <rayandrews@xxxxxxxxxxx> 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.




Messages sorted by: Reverse Date, Date, Thread, Author