Settings

Theme

Stop Writing Shell Scripts

samgrayson.me

5 points by charmonium 5 years ago · 4 comments

Reader

jimsparkman 5 years ago

Shell scripts are obviously imperfect, but I don’t necessarily agree with this absolutism view. In the right circumstances, you can quickly prototype an idea or process information in a shell script with such low friction. Truly the hacker mentality, which I don’t think a “real” language can always provide in the spur of the moment.

  • charmoniumOP 5 years ago

    I'm starting to come around to that view, especially since shell is an unusually productive REPL. What are the "right circumstances" for a shell script in your experience?

    • tutfbhuf 5 years ago

      Wrapper functions. If you want to extend or modify the functionality of already existing tools, but without altering them too much, so it wouldn't be worth to be a new tool on its own.

    • jimsparkman 5 years ago

      Admittedly, its not always apparent. I think a general rule of thumb for me is if I can effectively write the script in my mind ahead of time. Anything beyond that and I might regret choosing a shell script for the purpose.

      Sometimes a shell script just proves a concept out and is then rewritten later in a production language.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection