cs370:shrinkprint_script_q_and_a
Shrinkprint script Q & A
<== Back to shrinkprint project
- Q: Does the shell script have to be designed so that it somehow takes
textfile.txtandhh305as two parameters for use within the pipeline?- A: Yes,
textfile.txtwould be the first argument to the script, andhh305would be the second argument to the script.
- Q: Does the text have to be printed in landscape or portrait format, or would either format be acceptable?
- A: Output of
shrinkprintwill always be landscape.Enscripthas options to set landscape or portrait orientation, but don't use those options when you callenscriptwithinshrinkprint.
- Q: After running the script, a prompt appears where
Ctrl+Dexits the prompt and the file is then printed. What's up?- A: If you're left with a prompt after running the script, it usually means you have an unterminated single or double quote in the script.
- Q: Does the line at the top containing the filename, the date/time, and the page number have to be removed somehow?
- A:
Enscriptputs thatfilename-date-time-page-numberinformation at the top of pages by default. Forceenscriptnot to include that information.
- Q: Must the code have the ability to find other printers (such as
hh310), or can it be assumed that the targeted printer is accessible.- A: Just assume that the targeted printer is accessible. If it's not, the script will just exit with an error from
lprand nothing will be printed. If you're working in HH 305, usehh305. If you're working in HH 310, usehh310.
- Q: When I call
shrinkprintit doesn't recognize it as a command. What's up?- A: You need to make the
shrinkprintscript executable once with chmod +x shrinkprint, then either copy it to your ~/bin directory or run it with ./shrinkprint …
- Q:
Enscripthas a columns option that can duplicatepsnup'sfunctionality for the purposes of theshrinkprintscript. Should I use that option?- A: No, don't use that
enscriptoption.
- Q: When I run my script, the printer gives me 1 page of correct output and then one page of what looks like postscript code. Where's this page of postscript code coming from?
- A:
Enscriptis sending its output directly to the printer, instead of piping output topsnupas required. At the same time,psnupis piping some of its output tolpr, andlpris printing that page of postscript code. So, the page of actual output you're getting at the printer is fromenscript, while the page of useless postscript you're getting is frompsnup … | lpr …. The fix is to makeenscriptsend its postscript output to standard output, so that the postscript will actually be piped topsnup.
<== Back to shrinkprint project
cs370/shrinkprint_script_q_and_a.txt · Last modified: by jchung
