File: mp_print

package info (click to toggle)
mped 3.3.17-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,288 kB
  • ctags: 1,635
  • sloc: ansic: 13,150; sh: 393; makefile: 232; perl: 66
file content (33 lines) | stat: -rwxr-xr-x 491 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh
#
OPTFILE="$HOME/.lpopts"

case "$1" in
  print)
    if [ -f $OPTFILE ] ; then
     OPTS=`grep -v '^#' $OPTFILE`
    else
     OPTS=""
    fi
    lpr $OPTS    
    ;;
  preview)
    TMPFILE=`mktemp`
    cat > $TMPFILE
    xmore $TMPFILE
    rm -f $TMPFILE
    ;;
  setup)
    if [ ! -f $OPTFILE ] ; then
      cat >$OPTFILE <<EOF
#
# Enter the LPR command arguments you want to use
#
EOF
    fi
    xedit $OPTFILE
    ;;
  *)
    echo "usage: $0 {print|preview|setup}"
esac
exit 0