News for hackers. Stuff that matters.
Re:Brilliant or insane code? by akavel on Sunday September 01, 2013 @09:20AM (#6310233)
By the way, I was recently surprised by a similar pattern in linux, where you can do:

    (echo -e "one\ntwo\nthree\nfour") | paste -d, - -
to get result of:

    one,two
    three,four
by exploiting a similar trick, i.e. reading two times ('- -') from the same iterator (STDIN of 'paste')
Re:Brilliant or insane code? by apw on Sunday September 01, 2013 @03:45PM (#6311820)
Thanks for posting this. For reference, paste is a standard UNIX utility, whose purpose is to do all sorts of useful things not limited to 2-tuples:

  $ seq 1 9 | paste - - -
  1	2	3
  4	5	6
  7	8	9
Re:Brilliant or insane code? by tambourine_man on Sunday September 01, 2013 @07:30PM (#6312646)
No need for parentheses,

  echo -e "one\ntwo\nthree\nfour" | paste -d, - -
works just fine