4 ms·
> Shouldn't we discourage people from writing shell scripts? ...people frequently ask this? Tip #21 of "The Pragmatic Programmer" states: "Use the Power of Com
by wainstead 9y ago
> Shouldn't we discourage people from writing shell scripts?
...people frequently ask this? Tip #21 of "The Pragmatic Programmer" states: "Use the Power of Command Shells."
- partycoder 9y agoManipulating processes, exit codes and output is idiomatic in shells and that's where they shine. I totally agree with you. In a general purpose programming language there's a lot of overhead for doing the same things. For maintainability, there are now linters for shell languages that can help making the job easier.
- yjftsjthsd-h 9y ago> linters for shell languages Obligatory in case anyone hasn't seen it: https://www.shellcheck.net/ https://www.shellcheck.net/ Works as a web app or local tool.
- partycoder 9y agoPlease note that copying and pasting commands from a web browser into a terminal can result in malicious code being executed. A good idea to double check using a text editor. http://thejh.net/misc/website-terminal-copy-paste http://thejh.net/misc/website-terminal-copy-paste
- pbhjpbhj 9y agoSounds like sandboxing of pasted code until confirmation would be a good feature for a new shell ...
- yjftsjthsd-h 9y agoThere are terminals that do this, I believe.
- snag 9y agothanks for this
- LukeShu 9y agoThe last time an OSH article was posted, the top comment was that someone should submit a patch to Bash that makes it refuse to work for scripts longer than 50 lines. It's a strong sentiment that keeps getting repeated (I don't agree wit it).