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

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