home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / printers / pcprint.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  2020-01-01  |  1KB  |  38 lines

  1. #!/bin/sh
  2. #
  3. # pcprint
  4. #
  5. # Prints named files on locally attached PC or terminal printer, using 
  6. # "transparent print" commands.  If no files named on command line, prints
  7. # from standard input.
  8. #
  9. # Can be used with  with a VT102, VT2xx, or VT3xx terminal, that has a 
  10. # locally attached printer, or a PC running software such as Kermit 95 or
  11. # MS-DOS Kermit that emulates such a terminal.
  12. #
  13. # Works by sending the escape sequence ESC [ 5 i, which activates the
  14. # terminal's transparent print mechanism (meaning that the following
  15. # characters are sent to the local printer rather than the screen, and then
  16. # sends the escape sequence ESC [ 4 i, which turns off transparent printing
  17. # and puts the terminal back to normal.
  18. #
  19. # Note: On certain System-V based UNIX implementations, you might have to
  20. # change the hard escape in the 'echo' commands below into the sequence
  21. # caret (^) left bracket ([).
  22. #
  23. # Usage: pcprint file
  24. #    or: pcprint file file file ...
  25. #    or: pcprint < file
  26. #    or: command | pcprint
  27. #
  28. # Author: C. Gianone, Columbia University, 1988
  29. #
  30. echo -n 'i'
  31. if [ $# -eq 0 ]; then
  32.   cat
  33. else
  34.   cat $*
  35. fi
  36. echo -n 'i'
  37. # (end)
  38.