this is probably related to the fact that grap(1) is an APE program, and sh actually execs sh, not rc...
On Tue, Aug 10, 2010 at 2:23 AM, Jeff Sickel <[email protected]> wrote: > 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" == "(Yo" then { > print sprintf("Yo was %f", yo) > yo = sh { echo $3 | sed 's/\)#//' } > print sprintf("Yo is %f", yo) > } > > 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 = 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/\)#//' > 4.9534 > > > Does anyone have any hints on what might I be doing wrong in my grap source? > > -jas > > > -- Federico G. Benavento
