2 ms·
Perl. Python. Bash or shell scripts. They all have "invoke this shell command" at a minimum. Then you get into ssh and a host of other command invocations to ge
by AtlasBarfed 5y ago
Perl. Python. Bash or shell scripts. They all have "invoke this shell command" at a minimum. Then you get into ssh and a host of other command invocations to get information.
The shell is the convenient way to invoke commands to get the information: locally, remotely, quickly, no setup of C bindings, lots of invocation options.
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?
- 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