9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Federico G. Benavento" <benavento@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] regexp metacharacter difficulty inside grap
Date: Tue, 10 Aug 2010 10:10:51 -0300	[thread overview]
Message-ID: <AANLkTin3LJ=q1gTjAT8r80bZwC9C=ahWjNKRfsC=c6--@mail.gmail.com> (raw)
In-Reply-To: <09DB2D65-A18A-493E-9886-2D5D3334F460@corpus-callosum.com>

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 <jas@corpus-callosum.com> 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



  parent reply	other threads:[~2010-08-10 13:10 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-10  5:23 Jeff Sickel
2010-08-10  8:37 ` Steve Simon
2010-08-10  8:54 ` Rudolf Sykora
2010-08-10  9:14 ` Rudolf Sykora
2010-08-10 11:45 ` erik quanstrom
2010-08-10 13:06   ` Jeff Sickel
2010-08-10 13:10 ` Federico G. Benavento [this message]
2010-08-10 13:41   ` Rudolf Sykora
2010-08-10 13:58     ` Jeff Sickel
2010-08-10 14:11       ` erik quanstrom
2010-08-10 15:52         ` Russ Cox
2010-08-11  5:41           ` Jeff Sickel
2010-08-17  6:07           ` [9fans] iwp9 macros.ms + mkfile, (was--Re: regexp metacharacter difficulty inside grap) Jeff Sickel
2010-08-17 16:21             ` Russ Cox
2010-08-18  1:28               ` Jeff Sickel
2010-08-18  1:59                 ` Russ Cox
2010-08-20 14:58                   ` Jeff Sickel
2010-08-21  2:22                     ` Russ Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='AANLkTin3LJ=q1gTjAT8r80bZwC9C=ahWjNKRfsC=c6--@mail.gmail.com' \
    --to=benavento@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).