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

  1. #!/bin/sh
  2. #
  3. # pcaprint
  4. #
  5. # Prints named files on locally attached PC or terminal printer, using
  6. # "auto print" commands.  If no files named on command line, prints from
  7. # 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 autoprint mechanism (meaning that the following characters are
  15. # sent to the local printer after being placed on the screen) and then sends
  16. # the escape sequence ESC [ ? 4 i, which turns off auto printing and puts
  17. # 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, 1995
  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.