Named pipes

Last friday the guy behind the twinview setup on the desk in front of me tipped me on named pipes. Bash uses named pipes in a really neat way. When you enclose a command in parenthesis, the command is actually run in a subshell; that is, the shell clones itself and the clone interprets the command(s) within the parenthesis. Since the outer shell is running only a single command, the output of a complete set of commands can be redirected as a unit.

Since I learned this I mostly used it in combination with the diff command:

diff <(curl http://www.liekeensofie.nl//scripts/lightbox.js)
<(curl http://www.maas-frensch.com/sjoerd/wp-content/plugins/wp-lightboxJS/lightbox.js.php)

The above compares two webpages without the need of temporary files!


1 Response to “Named pipes”

  1. 1 Named pipes in OSX? at log4p

Leave a Reply





About

Welcome to the weblog of Peter Maas. Here you'll find various posts related to stuff I like (like my kids and espresso) and stuff I do (like developing software).

JavaOne 2008 Pictures


Moscone Center - JavaOne Hotel room Charles Nutter & Guillaume Laforge Java + You on a cab Community One Keynote Greenland golden_gate_warning_sign Cable Car line javaone 2008 goodybag Okke en Rudie Stretched Limo pub alcatraz javaone2008 keynote nearby hotel smashmouth Joshua Bloch at JavaOne2008 Stage being build in the nearby park Scribbled Sun Logo Tim Bray introducing the (J)Ruby panel
View more photos >

Categories



Meld u aan voor PayPal en begin direct met het accepteren van creditcardbetalingen.