from Hacker News

Ask HN: What do you use as a shell script replacement?

by ohgh1ieD on 8/2/16, 8:27 PM with 5 comments

I'm looking for a scripting language which is very well suited for smaller script on the server side ( linux ).

I know Perl, Ruby, Shell etc.. but I'd like to learn something new, something functional would be great. Is there something out there ? Maybe a Lisp dialect ? ( bonus points for many good examples on the internet ).

What do you use to manage your servers ?

  • by acemarke on 8/2/16, 9:02 PM

    Python and Plumbum ( https://plumbum.readthedocs.io/en/latest/ ). All kinds of binary-running / process-managing / file-manipulating goodness, inside of a sane language with actual logic and control structures. Plus, useful bits like SSH execution and CLI arg handling.
  • by earless1 on 8/2/16, 8:28 PM

    You might want to start using a proper configuration management tool like Ansibe,Chef,Puppet, or Salt
  • by user5994461 on 8/2/16, 8:28 PM

    Use ansible. It's like shell scripts on steroid.

    Basically, imagine a list of simple tasks, executing one by one in order.

    Instead of having bash commands which have crazy long arguments list and screw the whole script on failure, you get to use ansible commands (aka. modules) which are a lot easier to use and handle failures nicely (by stopping the run).

    And you'll never have to worry again about what happens when a command is ran twice. It simply doesn't do anything if there is nothing to change.