Is there any use for Bash scripting anymore?

The real difference between bash and python is that python is a general purpose scripting language, while bash is simply a way to run a myriad of small (and often very fast) programs in a series. Python can do this, but it is not optimized for it. The programs (sort, find, uniq, scp) might do very complex tasks very simply, and bash allows these tasks to interoperate very simply with piping, flushing output in and out from files or devices etc.

While Python can run the same programs, you will be forced to do bash scripting in the python script to accomplish the same thing, and then you are stuck with both python and bash. Both are fine by them self, but a mix of these don't improve anything IMHO.


Bash is incredibly useful in system administration, web application deployment, data crunching, automated backups, even getting-things-done day by day management just to name really few of them. I think It's too early for you to judge a "veteran IT soldier" like BASH.

EDIT googling around:

  • comprehensive list of nice examples
  • Useful bash tip and tricks
  • 18 useful scripts for Web Devel.
  • two minutes bash coding to improve your git usage

I'd like also to mention that TextMate a successful OS-X program has a lot of Bash machinery inside.


Bash scripts allow you to automate command line tasks by using the same language you would if you type the commands out manually.

Trivial Example to list $PATH

Bash

#!/bin/sh
echo $PATH

Python

import os
print os.getenv("path")

Among other things, bash is useful when most of what you're doing is communicating and piping between various programs (many of which are also standard). And there are many environments where bash (or at least a POSIX shell) is available but Perl and Python are not.

And of course, you should distinguish between interactive bash and scripted bash. Ubuntu recently switched their default scripted shell (#!/bin/sh) to dash because it was much faster. However, bash has useful interactive features dash does not (zsh is still better, IMHO).