News for hackers. Stuff that matters.
Re:Advanced Bash Scripting by 1010011010 on Sunday December 11, 2011 @10:29PM (#3342122)
Here's the short version of the Advanced Bash Scripting Guide: "Use Python".

Long bash scripts are less readable and maintainable than python scripts.

Re:Advanced Bash Scripting by draebek on Monday December 12, 2011 @01:01AM (#3342496)
Speaking as a person that converted a big shell script to Python a while back, I think both languages have their strengths. Writing something like:

    prog1 2> prog1.log | prog2 2> prog1.log | prog3
in Python is not nearly so succinct as in the shell (using only Python's standard library). And don't screw up waiting for processes or flushing buffers, things that the shell takes care of for you AFAIK.

On the other hand, things like string or date manipulation are easier in Python than in the shell.

Re:Advanced Bash Scripting by tikhonj on Sunday December 11, 2011 @10:58PM (#3342178)
It doesn't have to be Python--you can use pretty much any language you want, so just use your favorite one be it Ruby or Python or Haskell or whatever.

I personally only use Bash when the script is just a trivial translation of commands I enter.

Re:Advanced Bash Scripting by Maven911 on Sunday December 11, 2011 @11:53PM (#3342324)
sometimes you have no choice, such as working on telecom systems which have a stripped down Linux version running on it and there is no python/perl interpreter available.
Re:Advanced Bash Scripting by tikhonj on Monday December 12, 2011 @12:02AM (#3342353)
That's certainly a possibility. For me, however, the vast majority of scripts I write will only ever run on my own computer or maybe also on some AWS instances. I suspect this varies a lot based on what sorts of things you generally work on.
Re:Advanced Bash Scripting by rhizome31 on Monday December 12, 2011 @06:55AM (#3343257)
Sometimes you could write in Ruby/Python/Perl but it's a good idea to make a shell script instead, so that sysadmins can understand it.
Re:Advanced Bash Scripting by tingletech on Monday December 12, 2011 @02:56AM (#3342758)
I needed this guide to help me write my bash script that I use to build python and all its dependencies on all the machines I need to work on. That way I'm not at the mercy of whatever out of date python happens to be installed with the package manager by the admin.
Re:Advanced Bash Scripting by wazoox on Monday December 12, 2011 @02:39AM (#3342721)
Actually perl makes it way easier than python, because it supports more of bash features directly, from backticks to here-docs.
Re:Advanced Bash Scripting by burgerbrain on Monday December 12, 2011 @01:22AM (#3342554)
This guide is a great read even if all you do is short bash scripts.
Re:Advanced Bash Scripting by vlisivka on Monday December 12, 2011 @08:45AM (#3343496)
Shell is Lingua Franca for system administrators.