Print this page
XXX Remove nawk(1)

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/print/scripts/ppdfilename2mmp
          +++ new/usr/src/cmd/print/scripts/ppdfilename2mmp
↓ 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 make/model/nickname as well as the repository/label from ppdfilename
  30   28  #
  31   29  
  32   30  # Input
  33   31  #       ppdfilename
  34   32  #       /var/lp/ppd/user/HP/foo.ppd.gz
  35   33  # Output
  36   34  #       make
↓ open down ↓ 13 lines elided ↑ open up ↑
  50   48  [[ -f $cachefile ]] || exit 1
  51   49  
  52   50  cacheentry=$(/bin/grep "$1" $cachefile)
  53   51  [[ -n "$cacheentry" ]] || exit 1
  54   52  
  55   53  #
  56   54  # Retrieve the manufacturer (make)
  57   55  # Use only the first word in manufacturer entry
  58   56  #
  59   57  manuf=$(echo "$cacheentry" | 
  60      -nawk '{FS=":"; print $1}' |
  61      -nawk '{print $1}')
       58 +/usr/xpg4/bin/awk '{FS=":"; print $1}' |
       59 +/usr/xpg4/bin/awk '{print $1}')
  62   60  
  63   61  # Retrieve the model
  64      -model=$(echo "$cacheentry" | nawk '{FS=":"; print $2}')
       62 +model=$(echo "$cacheentry" | /usr/xpg4/bin/awk '{FS=":"; print $2}')
  65   63  
  66   64  # Retrieve the driver
  67      -driver=$(echo "$cacheentry" | nawk '{FS=":"; print $3}')
       65 +driver=$(echo "$cacheentry" | /usr/xpg4/bin/awk '{FS=":"; print $3}')
  68   66  
  69   67  #
  70   68  # Retrieve the PPD path.  Parse the PPD path to get the
  71   69  # label path and to figure out the repository letter
  72   70  # associated with the label path.  Note:
  73   71  # the PPD file name is the 6th colon separated entry
  74   72  # in the cache entry.  This is may need to be modified if the
  75   73  # format changes.
  76   74  #
  77      -ppdpath=$(echo "$cacheentry" | /bin/nawk '{FS=":"; print $6}' )
       75 +ppdpath=$(echo "$cacheentry" | /usr/xpg4/bin/awk '{FS=":"; print $6}' )
  78   76  manupath=$(/bin/dirname "$ppdpath")
  79   77  labelpath=$(/bin/dirname "$manupath")
  80   78  
  81   79  case "$labelpath" in
  82   80  /usr/share/ppd/*)
  83   81          repltr=S
  84   82                  ;;
  85   83  /opt/share/ppd/*)
  86   84          repltr=V
  87   85          ;;
↓ open down ↓ 13 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX