#!/bin/bash # # Syntax: a2ps1 [-h] [a2ps_options] file [...] # # Purpose: Uses a2ps to pretty print an ASCII file with 1 page per page # output. If the a2ps -o option is not specified, then the output # is sent to the printer. Note that the -o option also allows # multiple files to be specified. # The -h flag shows the help info for this command. # Created: Jul 12, 2004 by Bart De Schutter # Last revised: Apr 29, 2014 by Bart De Schutter # # See http://www.deschutter.info/util/scripts.html for the latest version of # this script. # Status: public # Category: printing if [ $# -ge 1 -a "$1" = "-h" ]; then sed '/^$/q;/^#!/d;s/^# //;s/^#//' $0 >&2 exit 1 fi if [ $# -lt 1 ] then echo >&2 echo >&2 "ERROR: ${0##*/} requires at least 1 input argument." echo >&2 sed '/^$/q;/^#!/d;s/^# //;s/^#//' $0 >&2 exit 1 fi a2ps --delegate=no --medium=a4 --columns=1 -R -K --sides=2 $@ #for fil in "$@" #do # a2ps --medium=a4 --columns=1 -R -K --sides=2 $fil #done