3 ms·
>If you are polyglot, do you want to use a command you know (ls) or learn each language's infernal syntax for filtering, recursive listing, etc, or learn it onc
by shatteredgate 5y ago
>If you are polyglot, do you want to use a command you know (ls) or learn each language's infernal syntax for filtering, recursive listing, etc, or learn it once with shell?
Probably learn the language's syntax because it's faster and more powerful, e.g. in python and perl I'd say don't bother with running shell commands and doing unnecessary forking and parsing if you can avoid it, use the built-in glob instead:
https://docs.python.org/3/library/glob.html https://docs.python.org/3/library/glob.html
https://perldoc.perl.org/functions/glob https://perldoc.perl.org/functions/glob
Most languages just have this now because it's easier and faster than invoking external programs and is a better cross platform solution, glibc even has it:
https://man7.org/linux/man-pages/man3/glob.3.html https://man7.org/linux/man-pages/man3/glob.3.html