Useful bashisms
Useful bashisms
Posted Oct 2, 2014 14:52 UTC (Thu) by gwolf (subscriber, #14632)In reply to: dash/ash by josh
Parent article: Bash gets shellshocked
Some bashisms are just too useful to dismiss. From the top of my mind, I often thank bash for being able to diff the output from two running programs without having to juggle them into named pipes:
$ diff -u <(cmd1) <(cmd2)
is way easier and clearer than
$ F1=`tempfile`
$ F2=`tempfile`
$ cmd1 > $F1 &
$ cmd2 > $F2 &
$ diff -u $F1 $F2
$ rm $F1 $F2
Of course, it makes sense to include this bashism in your scripts. And, of course, that'd make your scripts depend on bash.