xref: /titanic_50/usr/src/cmd/troff/troff.d/troff.sh (revision c77a61a72b5ecdc507d6cf104142edd371a16c84)
1#!/sbin/sh
2#
3# CDDL HEADER START
4#
5# The contents of this file are subject to the terms of the
6# Common Development and Distribution License, Version 1.0 only
7# (the "License").  You may not use this file except in compliance
8# with the License.
9#
10# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
11# or http://www.opensolaris.org/os/licensing.
12# See the License for the specific language governing permissions
13# and limitations under the License.
14#
15# When distributing Covered Code, include this CDDL HEADER in each
16# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
17# If applicable, add the following below this CDDL HEADER, with the
18# fields enclosed by brackets "[]" replaced with your own identifying
19# information: Portions Copyright [yyyy] [name of copyright owner]
20#
21# CDDL HEADER END
22#
23
24# Copyright 1989 Sun Microsystems, Inc.  All rights reserved.
25# Use is subject to license terms.
26
27#	Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T
28#	  All Rights Reserved
29
30# Portions of this source code were derived from Berkeley 4.3 BSD
31# under license from the Regents of the University of California.
32
33#ident	"%Z%%M%	%I%	%E% SMI"
34
35dev=aps
36oflags= newargs=
37
38for i
39do
40	case $i in
41	-Tcat)	dev=cat ;;
42	-Taps)	dev=aps ;;
43	-T*)	echo invalid option $i;  exit 1 ;;
44	-c*)	cm=`echo $i|sed -e s/c/m/`
45		newargs="$newargs $cm"
46		oflags=$oflags$i  ;;
47	-b|-k*|-p*|-g|-w)	oflags=$i$oflags ;;
48	*)	newargs="$newargs $i"  ;;
49	esac
50done
51
52case $dev in
53
54cat)
55	exec otroff $*
56	;;
57
58aps)
59	if [ "-b" = "$oflags" ]
60	then
61		echo '-b no longer supported'
62		exit 1
63	fi
64	if [ -n "$oflags" ]
65	then
66		echo "options -c, -k, -b, -w, -g and -p are no longer supported"
67	fi
68	exec troff $newargs
69	;;
70
71esac
72