3 ms·
What frameworks/libraries do you use? I find that the reason I prefer using a shell script is: * ergonomic integration with the shell * easy piping * easy in
by renewiltord 6y ago
What frameworks/libraries do you use? I find that the reason I prefer using a shell script is:
* ergonomic integration with the shell
* easy piping
* easy input/output redirection
Maybe Ruby comes close with the backticks or `system` but it still isn't as nice as a shell IMHO
- GuB-42 6y agoFor me, it would be Perl. Perl is influenced by shell scripting and there are several easy ways to run commands, build pipes, redirect and other things shells are good at, like testing and listing files. And as ugly as Perl looks, it has much less pitfalls than shell scripts.
- renewiltord 6y agoI wrote some Perl code once and it looks like you need more than a passing familiarity with the language to create code that is not just write-once.
- GuB-42 6y agoWith proper development practices, you can write clean Perl, even if you don't know much about the language. It has the same constructs as most other procedural languages and you can apply the same principles. Object orientation is a bit tricky though. The thing is, Perl won't help you with discipline. If you want write-only code, Perl will compile it, no problem. For that reason, it is the language of choice for one liners and throwaway scripts (and that's how I use it most or the times). But writing clean Perl is perfectly doable, though I usually prefer static languages if maintainable code is a priority (no Perl, no shell, not even Python).
- im3w1l 6y agoWhile bash itself has some warts, many of the issues are inherent to spawning child processes for accomplishing tasks. Thus, when possible, I try to use proper libraries rather than invoking commands from any language at all.
- renewiltord 6y agoI see. Which ones have you found most ergonomic to use?
- im3w1l 6y agoPython and as for libraries, well that's very dependent on what I want to accomplish, obviously.