Sunday, May 29, 2016

bash Process Substitution

Bash will automatically parallelize your tasks.

Replace
$ curl http://somesite/file1 > file1
$ curl http://somesite/file2 > file2
$ diff file1 file2

with
$ diff <(curl http://somesite/file1) <(curl http://somesite/file2)