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

Re: question mark in filename.



On Sun, Jan 10, 2021 at 4:56 PM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
>
> I tried ' ${(q)input} ' and variations because  that seems to swallow most
> things and I was suspicious.

If you want to extract the list of files from the output of `ls`,
you'll need to pass --quoting-style=shell and then parse the output
with ${(z)...}. If you just want to get a list of files that match a
pattern, you don't need `ls`.

    files=(s,7*)

I understand that your problem is likely more complex than the test
you've shown but even then it's likely that you can avoid parsing the
output of `ls`.

Roman.




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