9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: Re: [9fans] watching plumber
Date: Sat, 13 Mar 2010 10:31:37 -0500	[thread overview]
Message-ID: <8e5fcb8f889c1405c825c078261d2d88@brasstown.quanstro.net> (raw)
In-Reply-To: <a560a5d01003130245w4c4baf38u640f5ff2a91115b2@mail.gmail.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 2121 bytes --]

> plumb start 9 cat /home/ruda/CALC/manu/$1_source | plumb -i -d edit -a
> action=showdata
>
> I am getting this message when it is used
>
> /home/ruda/CALC/systems/ni4ni4ni4_264_fcc001_2/rotxy/Cxy.eps
> /home/ruda/CALC/systems/ni4ni4ni4_264_fcc001_2/rotzx/Czx.eps

why are you executing a rule instead of directly plumbing to edit?
i'm not sure all of the wheres and whys of what you're doing, but
it smells too complicated.  also, using annoying characters like
'[' and '] in filenames is complicating matters.

> Also, as I am using p9p now, I don't know who interprets the part
> after the 'plumb start'. I first, believing that rc does the job, had
> e.g.
> cat /home/ruda/CALC/manu/^$1^_source
> there (note the ^s), but then those ^s stayed intact in the name
> (which wasn't naturally found).

both the plumber and rc get a crack at it.  it's like `` in the
bourne shell.

so, for example, if i want to quote something in rc because i've
got a globbing character or other problem, i'd need a rule like
this:

type	is	text
data	matches	'\* x \*'
plumb	start	rc -c 'echo '''$0''' >> /tmp/junk'

3 's are needed.  two to generate a character-stuffed quote and
one to terminate or start quoting.  $0 must be interpreted by
plumber.

by the way, there's a (mostly harmless) bug in plumb's
basic rules:

/n/sources/plan9//sys/lib/plumb/basic:92,98 - basic:92,98
  # man index entries are synthesized
  type is text
  data matches '([a-zA-Z¡-￿0-9_\-./]+)\(([1-8])\)'
- plumb start rc -c 'man -b '$2' '$1'
+ plumb start rc -c 'man -b '$2' '$1

  # start rule for images without known suffixes
  dst is image

the reason this extra ' at the end is not flagged is
because the plumber doesn't check for unterminated
quotes.  this change to plumb's source would need
to be made to enable checking:

/n/sources/plan9//sys/src/cmd/plumb/rules.c:330,335 - rules.c:331,339
  	if(ends)
  		*ends = s;
  	*p = '\0';
+ 	/* disabled due to default plumbing having broken rule */
+ 	if(0 && quoting)
+ 		return "eof-in-quoted-string";
  	return ebuf;
  }

- erik



  reply	other threads:[~2010-03-13 15:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-12 23:25 Rudolf Sykora
2010-03-12 23:54 ` erik quanstrom
2010-03-13  0:16   ` Rudolf Sykora
2010-03-13  0:39     ` erik quanstrom
2010-03-13  8:19       ` Rudolf Sykora
2010-03-13 10:45 ` Rudolf Sykora
2010-03-13 15:31   ` erik quanstrom [this message]
2010-03-13 17:14     ` Rudolf Sykora
2010-03-13 19:18       ` Rudolf Sykora
2010-03-13 23:05         ` erik quanstrom
2010-03-14 15:55           ` Rudolf Sykora
2010-03-14 20:11             ` erik quanstrom
2010-03-15  4:53               ` Anthony Sorace
2010-03-18 15:34                 ` erik quanstrom

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=8e5fcb8f889c1405c825c078261d2d88@brasstown.quanstro.net \
    --to=quanstro@quanstro.net \
    --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).