Skip to content

Instantly share code, notes, and snippets.

@jgonggrijp
Created November 5, 2013 18:53
Show Gist options
  • Save jgonggrijp/7324067 to your computer and use it in GitHub Desktop.
Save jgonggrijp/7324067 to your computer and use it in GitHub Desktop.
This is a "function-wrapped" version of http://pastebin.com/Q5iDVxjR. `multiplex` takes a list of commands as arguments and applies each command in turn to each line on the standard input. `const` takes one command as an argument, which it will execute when anything is passed on stdin (which is then ignored).
xkcd-search '(?i)spider' | xkcd-fetch | multiplex "const 'echo -------'" "json-parse comic_title" "json-parse transcript" "json-parse number"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment