User Tools

Site Tools


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.txt and hh305 as two parameters for use within the pipeline?
    • A: Yes, textfile.txt would be the first argument to the script, and hh305 would 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 shrinkprint will always be landscape. Enscript has options to set landscape or portrait orientation, but don't use those options when you call enscript within shrinkprint.
  • Q: After running the script, a prompt appears where Ctrl+D exits 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: Enscript puts that filename-date-time-page-number information at the top of pages by default. Force enscript not 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 lpr and nothing will be printed. If you're working in HH 305, use hh305. If you're working in HH 310, use hh310.
  • Q: When I call shrinkprint it doesn't recognize it as a command. What's up?
    • A: You need to make the shrinkprint script executable once with chmod +x shrinkprint, then either copy it to your ~/bin directory or run it with ./shrinkprint …
  • Q: Enscript has a columns option that can duplicate psnup's functionality for the purposes of the shrinkprint script. Should I use that option?
    • A: No, don't use that enscript option.
  • 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: Enscript is sending its output directly to the printer, instead of piping output to psnup as required. At the same time, psnup is piping some of its output to lpr, and lpr is printing that page of postscript code. So, the page of actual output you're getting at the printer is from enscript, while the page of useless postscript you're getting is from psnup … | lpr …. The fix is to make enscript send its postscript output to standard output, so that the postscript will actually be piped to psnup.

<== Back to shrinkprint project


cs370/shrinkprint_script_q_and_a.txt · Last modified: 2014/10/06 17:11 by jchung

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki