Enscript, Cygwin, Lpr, ...
I posted an elaborate script for pretty-printing code listings 19 days ago:
On Linux systems, enscript is hooked up directly to the default printer, so a simple command like:
[weiqi@gao] $ enscript Foo.javawill do.
On Windows, I use Cygwin to accomplish what I want. Things are not as automatic as on Linux, ...
I have learned since then that, in Cygwin too, enscript is properly hooked up to the default printer, just like on Linux. So I have thrown away that script, and use the enscript command directly.
Re: Enscript, Cygwin, Lpr, ...
At the moment, Cygwin's lpt doesn't work for me. So I have to resort to using Adobe Reader:
#!/bin/bash # # print-code # # Generate a filename based on the current date/time FILENAME=`date +%Y%m%d%H%M` # # Generate PostScript enscript "$@" -o $FILENAME.ps # # Generate PDF ps2pdf $FILENAME.ps # # Print PDF with Adobe Reader c:/Program\ Files/Adobe/Acrobat\ 7.0/Reader/AcroRd32.exe /p $FILENAME.pdf # # Remove temporary files \rm $FILENAME.ps $FILENAME.pdf