Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Pipes and Filters.
• Though the first pipeline is didactic, it can be done entirely within awk:
awk ' BEGIN { l=0 } /purple/ { if(length($1) >= l) { word = $1; l = length($1) } } END { print word }' < /usr/share/dict/words
( ( ( echo out echo err >&2 ) | while read out; do echo "out: $out"; done >&3 ) 2>&1 | while read err; do echo "err: $err"; done ) 3>&1
There are no comments on this comment yet.
• Though the first pipeline is didactic, it can be done entirely within awk:
• Named pipes are neat, but you can also use subshells and additional FDs (I am in no way arguing this is more clear): • Bash has "set -o pipefail" for cases where you want any process in the pipeline that exits non-zero to cause the entire pipeline to exit non-zero.