Deleted Added
full compact
lp.sh (50479) lp.sh (57816)
1#!/bin/sh
2#
3#
4# Copyright (c) 1995 Joerg Wunsch
5#
6# All rights reserved.
7#
8# This program is free software.

--- 22 unchanged lines hidden (view full) ---

31# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
34# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35#
36#
37# Posix 1003.2 compliant print spooler interface.
38#
1#!/bin/sh
2#
3#
4# Copyright (c) 1995 Joerg Wunsch
5#
6# All rights reserved.
7#
8# This program is free software.

--- 22 unchanged lines hidden (view full) ---

31# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
34# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35#
36#
37# Posix 1003.2 compliant print spooler interface.
38#
39# $FreeBSD: head/usr.sbin/lpr/lp/lp.sh 50479 1999-08-28 01:35:59Z peter $
39# $FreeBSD: head/usr.sbin/lpr/lp/lp.sh 57816 2000-03-08 10:02:11Z sheldonh $
40#
41
42ncopies=""
43symlink="-s"
44
45# Posix says LPDEST gets precedence over PRINTER
46dest=${LPDEST:-${PRINTER:-lp}}
47
48#
49# XXX We include the -o flag as a dummy. Posix 1003.2 does not require
50# it, but the rationale mentions it as a possible future extension.
40#
41
42ncopies=""
43symlink="-s"
44
45# Posix says LPDEST gets precedence over PRINTER
46dest=${LPDEST:-${PRINTER:-lp}}
47
48#
49# XXX We include the -o flag as a dummy. Posix 1003.2 does not require
50# it, but the rationale mentions it as a possible future extension.
51# XXX We include the -s flag as a dummy. SUSv2 requires it,
52# although we do not yet emit the affected messages.
51#
53#
52while getopts "cd:n:o:" option
54while getopts "cd:n:o:s" option
53do
54 case $option in
55
56 c) # copy files before printing
57 symlink="";;
58 d) # destination
59 dest="${OPTARG}";;
60 n) # number of copies
61 ncopies="-#${OPTARG}";;
62 o) # (printer option)
63 : ;;
55do
56 case $option in
57
58 c) # copy files before printing
59 symlink="";;
60 d) # destination
61 dest="${OPTARG}";;
62 n) # number of copies
63 ncopies="-#${OPTARG}";;
64 o) # (printer option)
65 : ;;
66 s) # (silent option)
67 : ;;
64 *) # (error msg printed by getopts)
65 exit 2;;
66 esac
67done
68
69shift $(($OPTIND - 1))
70
71exec /usr/bin/lpr "-P${dest}" ${symlink} ${ncopies} "$@"
68 *) # (error msg printed by getopts)
69 exit 2;;
70 esac
71done
72
73shift $(($OPTIND - 1))
74
75exec /usr/bin/lpr "-P${dest}" ${symlink} ${ncopies} "$@"