Print this page
XXX Remove nawk(1)

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libshell/common/tests/quoting.sh
          +++ new/usr/src/lib/libshell/common/tests/quoting.sh
↓ open down ↓ 321 lines elided ↑ open up ↑
 322  322  [[ ${subject/${re}/"${string}"} != '\4' ]] && err_exit 'string replacement with "$string" not working with  string=\4'
 323  323  string='&foo'
 324  324  [[ ${subject/${re}/${string}} != '&foo' ]] && err_exit 'string replacement with $string not working with string=&foo'
 325  325  [[ ${subject/${re}/"${string}"} != '&foo' ]] && err_exit 'string replacement with "$string" not working with  string=&foo'
 326  326  {
 327  327  x=x
 328  328  x=${x:-`id | sed 's/^[^(]*(\([^)]*\)).*/\1/'`}
 329  329  } 2> /dev/null || err_exit 'skipping over `` failed'
 330  330  [[ $x == x ]] || err_exit 'assignment ${x:=`...`} failed'
 331  331  [[ $($SHELL -c 'print a[') == 'a[' ]] || err_exit "unbalanced '[' in command arg fails"
 332      -$SHELL -c $'false && (( `wc -l /dev/null | nawk \'{print $1}\'` > 2 )) && true;:' 2> /dev/null ||  err_exit 'syntax error with ` in arithmetic expression'
      332 +$SHELL -c $'false && (( `wc -l /dev/null | /usr/xpg4/bin/awk \'{print $1}\'` > 2 )) && true;:' 2> /dev/null ||  err_exit 'syntax error with ` in arithmetic expression'
 333  333  { $SHELL  -c '((  1`: "{ }"` ))' ;} 2> /dev/null || err_exit 'problem with ` inside (())'
 334  334  varname=foobarx
 335  335  x=`print '"\$'${varname}'"'`
 336  336  [[ $x == '"$foobarx"' ]] ||  err_exit $'\\$\' not handled correctly inside ``'
 337  337  
 338  338  copy1=5 copynum=1
 339  339  foo="`eval echo "$"{copy$copynum"-0}"`"
 340  340  [[ $foo == "$copy1" ]] || err_exit '$"..." not being ignored inside ``'
 341  341  
 342  342  exit $((Errors))
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX