System Administration Guide
Chapter 4, Managing printers and print jobs

Handling different stty settings

Handling different stty settings

If the terminal and printer require different stty settings, you must create a shell script to handle that:

  1. Create a file called lprints and enter the following text:
       # /usr/bin/lprints
       # Do local printing with stty settings that differ from
       # those of the terminal. The required settings are read
       # from environment variable LPRINTSTTY.

    oldstty=`stty -g` [ "$LPRINTSTTY" != "" ] && stty $LPRINTSTTY

    FORMS=X /usr/bin/lprint "$@"

    stty $oldstty

  2. Change the permissions on the file:

    chmod 755 lprints

  3. Put the file in an appropriate directory (for example: /usr/bin) and use it instead of lprint:

    lprints filename

    Users can store the stty settings required for a local printer using the environment variable LPRINTSTTY. You can set system-wide values in the /etc/profile and /etc/cshrc files:

       LPRINTSTTY="ixon ixoff -ixany onlcr"; export LPRINTSTTY

See also: