Xref: utzoo unix-pc.general:264 comp.sys.att:2332 Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!amdcad!ames!lll-tis!ptsfa!pacbell!pb2esac!pttesac!vanam From: vanam@pttesac.UUCP (Marnix van Ammers) Newsgroups: unix-pc.general,comp.sys.att Subject: bug in ksh on UNIX-PC (?) Message-ID: <673@pttesac.UUCP> Date: 31 Jan 88 04:39:43 GMT Organization: Pacific*Bell ESAC, San Francisco, Ca. Lines: 26 Keywords: bug ksh 3b1 unix-pc 7300 # 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