bug in ksh on UNIX-PC (?)

Marnix van Ammers vanam at pttesac.UUCP
Sun Jan 31 14:39:43 AEST 1988


# On the UNIX-PC (ver 3.51), the korn shell causes awk to complain
# when run on this script
# but the bourne shell works fine.  Both the bourne and the korn
# shell work fine on this script in our 3B20 (System V rel 2.1.1).

Test_String="
  This is line 1
  and this is line two
  and this here is line three."

Results=`echo "$Test_String" | \
  awk " NF > 5 { print \\$6 } "`

# Trouble is here -----^^
# The double backslashes are converted to one when the doube quotes
#    are evaluated and to zero when the grave accents are evaluated.
#    The UNIX-PC ksh ends up passing the (null) 6th shell parameter
#    instead of '$6' .

echo "$Results"
-- 
Marnix (ain't unix!) A.  van\ Ammers		Work: (415) 545-8334
Home: (707) 644-9781				CEO: MAVANAMMERS:UNIX
WORK UUCP: {ihnp4|ptsfa}!pttesac!vanam		CIS: 70027,70
HOME UUCP: pttesac!Marnix!vanam 



More information about the Comp.sys.att mailing list