#!/bin/sh case "$1" in -*|'') ;; *) echo "Warning: $0: ignoring stdin and using first argument as input ($1)" >&2 exec < "$1" shift ;; esac expand | text2png | lp "$@"