
| Current Path : /bin/X11/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : //bin/X11/a2ps-lpr-wrapper |
#!/bin/bash
#
# a2ps-lpr-wrapper - lp/lpr wrapper script for GNU a2ps on Debian
#
TEMP=`getopt -o d: -n 'a2ps-lpr-wrapper' -- "$@"`
a2ps_printer=""
if [ $? != 0 ]; then echo "Terminating..." >&2; exit 1; fi
# Note the quotes around `$TEMP': they are essential!
eval set -- "$TEMP"
while true ; do
case "$1" in
-d) a2ps_printer=$2; shift 2 ;;
--) shift; break ;;
*) echo "usage: a2ps-lpr-wrapper -d [printer] [files]"; exit 1 ;;
esac
done
# If /usr/bin/lp (from cupsys-client) exists, just use it.
if [ -x /usr/bin/lp ]; then
if [ "x$a2ps_printer" != "x" ]; then d="-d $a2ps_printer"; else d=""; fi
/usr/bin/lp $d "$@"
elif [ -x /usr/bin/lpr ]; then
# In case /usr/bin/lp is not available, then fall back /usr/bin/lpr.
if [ "x$a2ps_printer" != "x" ]; then P="-P $a2ps_printer"; else P=""; fi
/usr/bin/lpr $P "$@"
elif [ -x /usr/bin/rlpr ]; then
# In case /usr/bin/lpr is not available, then fall back /usr/bin/rlpr.
if [ "x$a2ps_printer" != "x" ]; then P="-P $a2ps_printer"; else P=""; fi
/usr/bin/rlpr $P "$@"
else
# If any of lp, lpr and rlpr is not available, then fail
echo "$0: lp/lpr/rlpr missing!"
exit 1
fi