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!


82 Responses 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


golden_gate_warning_sign pub Okke en Rudie Acme Anvile at CommunityOne Keynote Rudie Greenland Tim Bray introducing the (J)Ruby panel nearby hotel javaone2008 keynote sea_lion Joshua Bloch at JavaOne2008 Cable Car line Stage being build in the nearby park Community One Keynote javaone 2008 goodybag Charles Nutter & Guillaume Laforge Golden Gate Moscone Center - JavaOne alcatraz Scribbled Sun Logo
View more photos >

Categories



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