Print this page
XXX Remove nawk(1)

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/print/scripts/getppdfile
          +++ new/usr/src/cmd/print/scripts/getppdfile
↓ open down ↓ 14 lines elided ↑ open up ↑
  15   15  # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16   16  # If applicable, add the following below this CDDL HEADER, with the
  17   17  # fields enclosed by brackets "[]" replaced with your own identifying
  18   18  # information: Portions Copyright [yyyy] [name of copyright owner]
  19   19  #
  20   20  # CDDL HEADER END
  21   21  #
  22   22  # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  23   23  # Use is subject to license terms.
  24   24  #
  25      -# ident "%Z%%M% %I%     %E% SMI"
  26      -#
  27   25  
  28   26  #
  29   27  # Get the path/ppdfilename for this ppd NickName
  30   28  # Input:
  31   29  #       make: model: ppdlabel: ppd:
  32   30  #       PrintersRus: ABC Model 1234: SUNWfoomatic(S): Foomatic/Postscript (recommended):
  33   31  #
  34   32  
  35   33  #
  36   34  # Returns the full path to the repository associated with
↓ open down ↓ 18 lines elided ↑ open up ↑
  55   53                  echo "/var/lp/ppd"
  56   54                  ;;
  57   55          esac
  58   56  }
  59   57  
  60   58  if [[ $# -lt 4 ]]; then
  61   59          exit 1
  62   60  fi
  63   61  
  64   62  [[ -f /var/lp/ppd/ppdcache ]] || exit 1
  65      -make=$(echo $* | /usr/bin/nawk '{FS=":"; print $1}')
       63 +make=$(echo $* | /usr/xpg4/bin/awk '{FS=":"; print $1}')
  66   64  # strip leading blanks
  67      -model=$(echo $* | /usr/bin/nawk '{FS=":"; print $2}' |
       65 +model=$(echo $* | /usr/xpg4/bin/awk '{FS=":"; print $2}' |
  68   66      /bin/sed -e 's/^[ ]*//')
  69      -extppdlabel=$(echo $* | /usr/bin/nawk '{FS=":"; print $3}' |
       67 +extppdlabel=$(echo $* | /usr/xpg4/bin/awk '{FS=":"; print $3}' |
  70   68      /bin/sed -e 's/^[ ]*//')
  71      -ppd=$(echo $* | /usr/bin/nawk '{FS=":"; print $4}' |
       69 +ppd=$(echo $* | /usr/xpg4/bin/awk '{FS=":"; print $4}' |
  72   70      /bin/sed -e 's/^[ ]*//')
  73   71  
  74   72  #
  75   73  # Do not use ":" with $make. printmgr collapses manufacturer name
  76   74  # to first word, ie PrintersRus and PrintersRus International become
  77   75  # PrintersRus.  The full path to the PPD file will be the 6th
  78   76  # colon separated entry in the ppdcache entry.  If the format
  79   77  # of a ppdcache entry changes, then this will need to be modified
  80   78  # also.
  81   79  #
  82   80  /bin/grep "${make}" /var/lp/ppd/ppdcache | 
  83   81      /bin/grep "${model}:" |
  84   82      /bin/grep "${ppd}:"  |
  85   83      /bin/grep "$(rep_path ${extppdlabel})/${extppdlabel%\(*}" |
  86      -    /usr/bin/nawk '{FS=":"; print $6}' 
       84 +    /usr/xpg4/bin/awk '{FS=":"; print $6}' 
  87   85  
  88   86  exit 0
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX