Henry Griggs RamblingHomeHomePhoto Gallery Recent TopicsVisit to Australia 2002Sydney house 2002 Circular Quay 2004 Circular Quay 2002 Centrepoint Tower 2004 Oz Birds 2004 Oz Birds 2002 Bridge Climb 2002 Popular TopicsGallbladder removalPhoto of the day HP Calculators Linux/Slackware notes Ripping/burning CDROMs Geek Alaska 2003 UK in 2003 Geek Caribbean 2002 Main TopicsAnneAnne's Crafts Blog Cats Collecting Commentary Credits Events Films Links Linux Michelle Miscellaneous Me Photo Galleries Photo Of The Day Rachael Site Index Travel Us Want List Work NavigationSite MapContactEmail MeSearchAdvanced searchRelated SitesHampton Road EventsHenry's Notes Anne's Site Hampton Roads Aussies Juniper Rowing Club Great Dismal Regatta Virginia Beach Belles Virginia Beach Rowing Club Williamsburg Boat Club |
My Current Shell Script Input Filter[Linux]
#!/usr/bin/bash
# Get the environment set up to access everything
PS_TO_PRINTER="gs -q -sDEVICE=ljet4 -sPAPERSIZE=letter -dNOPAUSE -dSAFER \
-sOutputFile=- -"
MAGIC=$(file -)
# Rewindstdin comes in Red Hat's rhs-printfilters package.
/usr/local/bin/rewindstdin
case `echo $MAGIC | tr 'A-Z' 'a-z'` in
*postscript* )
$PS_TO_PRINTER ;;
*ascii* | *text* | *english* | *script* )
a2ps - -q -o - | $PS_TO_PRINTER ;;
*"tex dvi file"* )
dvips -f | $PS_TO_PRINTER ;;
*)
echo -e "Don't know how to print that type of file.\r"
printf '\014' ;;
esac
|