even better, it accepts line noise as input. from the manpage:
To put two pages on one sheet (of A4 paper), the pagespec to use is:2:0L@.7(21cm,0)+1L@.7(21cm,14.85cm)
To select all of the odd pages in reverse order, use:2:-0
To re-arrange pages for printing 2-up booklets, use4:-3L@.7(21cm,0)+0L@.7(21cm,14.85cm)
for the front sides, and4:1L@.7(21cm,0)+-2L@.7(21cm,14.85cm)
for the reverse sides.
pstops is part of psutils.