Re:Fixing Unix/Linux/Posix Filenames: Control Characters (Su...
by JdeBP on Sunday March 10, 2019 @05:00AM
(#19351075)
Hence Greg Wooledge's famous advice not to parse the output of ls. As catern points out, in a fully-fledged systems programming language, one can just directly call the library routines that read directories. And thereby obtain metadata without having to parse it from locale-dependent forms, too.
Eg:
Ls | foo | bar
Ls just prints nl separated strings, no metadata, nothing to tell you what it is.
In current practical terms that means avoiding the shell, that isn't inherent though. I guess powershell avoids this issue.