Print this page
XXX Remove nawk(1)

Split Close
Expand all
Collapse all
          --- old/usr/src/test/zfs-tests/tests/functional/acl/acl_common.kshlib
          +++ new/usr/src/test/zfs-tests/tests/functional/acl/acl_common.kshlib
↓ open down ↓ 46 lines elided ↑ open up ↑
  47   47  #
  48   48  # $1 object -- file or directroy
  49   49  #
  50   50  function get_acl #<obj>
  51   51  {
  52   52          typeset obj=$1
  53   53          if (( ${#obj} == 0 )); then
  54   54                  return 1
  55   55          fi
  56   56  
  57      -        $LS -vd $obj | $NAWK '(NR != 1) {print $0}'
       57 +        $LS -vd $obj | $AWK '(NR != 1) {print $0}'
  58   58  }
  59   59  
  60   60  #
  61   61  # Get the given file/directory ACL
  62   62  #
  63   63  # $1 object -- file or directroy
  64   64  #
  65   65  function get_compact_acl #<obj>
  66   66  {
  67   67          typeset obj=$1
  68   68          if (( ${#obj} == 0 )); then
  69   69                  return 1
  70   70          fi
  71   71  
  72      -        $LS -Vd $obj | $NAWK '(NR != 1) {print $0}'
       72 +        $LS -Vd $obj | $AWK '(NR != 1) {print $0}'
  73   73  }
  74   74  
  75   75  #
  76   76  # Check the given two files/directories have the same ACLs
  77   77  #
  78   78  # Return 0, if source object acl is equal to target object acl.
  79   79  #
  80   80  # $1 source object
  81   81  # $2 target object
  82   82  #
↓ open down ↓ 108 lines elided ↑ open up ↑
 191  191  #
 192  192  # $1 object -- file or directory.
 193  193  #
 194  194  function plus_sign_check_v #<obj>
 195  195  {
 196  196          typeset obj=$1
 197  197          if (( ${#obj} == 0 )); then
 198  198                  return 1
 199  199          fi
 200  200  
 201      -        $LS -vd $obj | $NAWK '(NR == 1) {print $1}' | $GREP "+\>" > /dev/null
      201 +        $LS -vd $obj | $AWK '(NR == 1) {print $1}' | $GREP "+\>" > /dev/null
 202  202  
 203  203          return $?
 204  204  }
 205  205  
 206  206  #
 207  207  # A wrapper function of c program
 208  208  #
 209  209  # $1 legal login name
 210  210  # $2-n commands and options
 211  211  #
↓ open down ↓ 29 lines elided ↑ open up ↑
 241  241  #
 242  242  # $1 file or directroy name
 243  243  #
 244  244  function count_ACE #<file or dir name>
 245  245  {
 246  246          if [[ ! -e $1 ]]; then
 247  247                  log_note "Need input file or directroy name."
 248  248                  return 1
 249  249          fi
 250  250  
 251      -        $LS -vd $1 | $NAWK 'BEGIN {count=0}
      251 +        $LS -vd $1 | $AWK 'BEGIN {count=0}
 252  252                          (NR != 1)&&(/[0-9]:/) {count++}
 253  253                          END {print count}'
 254  254  
 255  255          return 0
 256  256  }
 257  257  
 258  258  #
 259  259  # Get specified number ACE content of specified file or directory.
 260  260  #
 261  261  # $1 file or directory name
↓ open down ↓ 365 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX