pr-paper 298 B

123456789101112131415161718
  1. #!/bin/bash -e
  2. if [ "$#" -lt "1" ]; then
  3. APPNAME=$(basename $0)
  4. echo "not enough arguments to $APPNAME"
  5. exit 1
  6. fi
  7. OPTS="-P hp4200n -o number-up=2 -o sides=two-sided-long-edge"
  8. if [[ "$1" = http* ]]; then
  9. FILE=$(mktemp)
  10. curl "$1" >$FILE
  11. lpr $OPTS $FILE
  12. rm $FILE
  13. else
  14. lpr $OPTS "$1"
  15. fi