Advertisement
dingodog

reorder4booklet1 (shuffle for 2up impose) NOT USABLE IN PIPE

Sep 23rd, 2011
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.57 KB | None | 0 0
  1. #!/bin/sh
  2. #simple script to get range of pages to use for reordering pages in a pdf, in order to impose as booklet with another program like Multivalent Impose tool. Interactive version, not usable in pipes
  3. #
  4. #number of pages must be a multiple of 4 or script will exit
  5. #
  6. echo " enter number of pages"
  7. read tot
  8. if [ $(( $tot % 4 )) -eq 0 ]
  9.     then
  10. tot4="`let DIVISION=$tot/2; echo $DIVISION`"
  11. for ((x=$tot, y=1;x>=$tot4, y<=tot4;x--, y++)); do echo "$x $y "; done | awk '{ print ; getline ; print $2, $1 }' | tr '\n' ' '
  12.     else
  13. echo " $tot is not a multiple of 4"
  14. fi
  15. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement