Sujet : Enscript
De : OFeem1987 (at) *nospam* teleworm.us (Chris Ahlstrom)
Groupes : comp.os.linux.advocacyDate : 23. Oct 2024, 13:54:11
Autres entêtes
Organisation : None
Message-ID : <vfarm9$21oij$1@dont-email.me>
User-Agent : slrn/1.0.3 (Linux)
I haven't used enscript for quite awhile. I used it all the time at work to
print code without having to use a text editor to do it. Here's part of a
script to convert a text file to PDF, with line numbers and a narrow font
suitable to printing. Blank lines and some info output removed.
#!/bin/bash
FONT="Monospace8"
OPTIONS="q -B -C -G -T3"
for FILENAME in $* ; do
# Get the whole filename, then strip off the whole file extension.
BASENAME="${FILENAME%%.*}"
EXTENSION="${FILENAME##*.}"
EOPTION="E"
[ "$EXTENSION" == "hpp" ] && EOPTION="Ecpp"
[ "$EXTENSION" == "h" ] && EOPTION="Ec"
enscript -$OPTIONS -$EOPTION -f $FONT -p - $FILENAME | ps2pdf - $BASENAME.pdf
done
--
A selection from the Taoist Writings:
"Lao-Tan asked Confucius: `What do you mean by benevolence and righteousness?'
Confucius said: `To be in one's inmost heart in kindly sympathy with all
things; to love all men and allow no selfish thoughts: this is the nature
of benevolence and righteousness.'"
-- Kwang-tzu