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 (c) 1994, 1995, 1996 by Sun Microsystems, Inc.
25 # All Rights Reserved
26 #
27 # ident "%Z%%M% %I% %E% SMI"
28 #
29 # Printcap <-> Printers.conf conversion utility...
30 #
31 # Usage: conv_lpd [ -c (printers|printcap) ] [ -n ] (file)
32 #
33
34 TEXTDOMAIN="SUNW_OST_OSCMD"
35 export TEXTDOMAIN
36
37 USAGE=`gettext "Usage: conv_lpd [ -c (printers|printcap) ] [ -n ] (file)\n"`
38
39 PATH=/usr/bin:/bin:/usr/sbin export PATH
40 conversion="printers"
41 namelist=0
42
43 umask 022
44
45 for i in $*
46 do
47 case $1 in
48 -c*)
86 echo "$0:"
87 gettext "Fatal Error: $CONV_FIX failed.\n"
88 gettext "Please contact your Sun support representative.\n"
89 exit 1
90 fi
91 else
92 gettext "$0: Fatal: Cannot locate $CONV_FIX binary.\n"
93 gettext "Please contact your Sun support representative.\n"
94 exit 1
95 fi
96
97 #
98 # Continuation characters are now stripped. Continue processing.
99 #
100 /bin/sed -e "s/:[ ]*:/:/g" $TMPF2 > $FILE
101
102 #
103 # Empty colons ":[ <TAB>]*:" are now stripped. Continue processing.
104 #
105
106 nawk '
107 BEGIN {
108 "uname -n" | getline ;
109 host = $0 ;
110 found = 0 ;
111 local_pr = 0;
112 }
113
114 {
115 FS=":"; OFS=":" ;
116 if ($0 !~ /^#/)
117 {
118 if ($0 ~ /^[_a-zA-Z0-9_]/) { # New entry
119 if ( found != 0 ) {
120 if ( "'$namelist'" == 1 )
121 printer = names ;
122 else
123 printer = name[1] ;
124
125 if ( "'$conversion'" == "printers" ) {
126 printf "\n%s:", names ;
|
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 (c) 1994, 1995, 1996 by Sun Microsystems, Inc.
25 # All Rights Reserved
26 #
27 # Printcap <-> Printers.conf conversion utility...
28 #
29 # Usage: conv_lpd [ -c (printers|printcap) ] [ -n ] (file)
30 #
31
32 TEXTDOMAIN="SUNW_OST_OSCMD"
33 export TEXTDOMAIN
34
35 USAGE=`gettext "Usage: conv_lpd [ -c (printers|printcap) ] [ -n ] (file)\n"`
36
37 PATH=/usr/bin:/bin:/usr/sbin export PATH
38 conversion="printers"
39 namelist=0
40
41 umask 022
42
43 for i in $*
44 do
45 case $1 in
46 -c*)
84 echo "$0:"
85 gettext "Fatal Error: $CONV_FIX failed.\n"
86 gettext "Please contact your Sun support representative.\n"
87 exit 1
88 fi
89 else
90 gettext "$0: Fatal: Cannot locate $CONV_FIX binary.\n"
91 gettext "Please contact your Sun support representative.\n"
92 exit 1
93 fi
94
95 #
96 # Continuation characters are now stripped. Continue processing.
97 #
98 /bin/sed -e "s/:[ ]*:/:/g" $TMPF2 > $FILE
99
100 #
101 # Empty colons ":[ <TAB>]*:" are now stripped. Continue processing.
102 #
103
104 /usr/xpg4/bin/awk '
105 BEGIN {
106 "uname -n" | getline ;
107 host = $0 ;
108 found = 0 ;
109 local_pr = 0;
110 }
111
112 {
113 FS=":"; OFS=":" ;
114 if ($0 !~ /^#/)
115 {
116 if ($0 ~ /^[_a-zA-Z0-9_]/) { # New entry
117 if ( found != 0 ) {
118 if ( "'$namelist'" == 1 )
119 printer = names ;
120 else
121 printer = name[1] ;
122
123 if ( "'$conversion'" == "printers" ) {
124 printf "\n%s:", names ;
|