Hacker News new | past | comments | ask | show | jobs | submit login

> 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."




The 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).


Manipulating 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.


> linters for shell languages

Obligatory in case anyone hasn't seen it:

https://www.shellcheck.net/

Works as a web app or local tool.


Please 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


Sounds like sandboxing of pasted code until confirmation would be a good feature for a new shell ...


There are terminals that do this, I believe.


thanks for this




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: