#!/bin/sh
# Usage: spr [-P<printer>] [<filename>...]
# Prints the document in simplex
# Can be overridden by the document, so does work as expected only if
# the document doesn't specify any duplex preferences
if echo "x$1" | grep "^x-P" > /dev/null; then
  flags="$1"
  shift
fi
(
  echo "%!"
  echo "<</Duplex false>> setpagedevice"
  cat "$@"
) | lpr $flags
