On GNU systems you can use ls -Q, which puts double quotes around file names, and escapes newlines as \n and quotes as \". Or the -b option, which does just the escaping without quoting. That output can be parsed unambiguously.
In reply to Re: How to efficiently parse "ls -a"?
by moritz
in thread How to efficiently parse "ls -a"?
by isync
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |