From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Sickel Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Date: Tue, 10 Aug 2010 00:23:44 -0500 Message-Id: <09DB2D65-A18A-493E-9886-2D5D3334F460@corpus-callosum.com> To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Mime-Version: 1.0 (Apple Message framework v1081) Subject: [9fans] regexp metacharacter difficulty inside grap Topicbox-Message-UUID: 46479bde-ead6-11e9-9d60-3106f5b1d025 I've been trying to figure out this little one for a while now and = figure I could use a refresher course in regexp. There are quite a few files that I'm trying to copy through grap that = would be really easy if I could take a line like: # (Yo 4.9534) and turn it into a value for x,y graphing. Unfortunately, I'm = completely blanking out on how to get that pesky ')' stripped out. I = try the following: if "$2" =3D=3D "(Yo" then { print sprintf("Yo was %f", yo) yo =3D sh { echo $3 | sed 's/\)#//' } print sprintf("Yo is %f", yo) }=20 but that just gives me: cpu% eval `{doctype t.g} | lp -dstdout > t.ps Yo was 8.579000 rc: line 2: token ')': syntax error grap: syntax error???: No such file or directory near 20100809_pscheck_XX.d:8 context is yo =3D sh { echo 4.9534)# | sed 's/\)#//' } >>> <<< I'm not quite sure why grap converts $3 into "4.9534)#", so I try brute = force: cpu% echo '4.9534)#' | sed 's/\)#//'=20 4.9534 Does anyone have any hints on what might I be doing wrong in my grap = source? -jas