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] rc word splitting trouble
Date: Sat,  3 Apr 2010 10:38:11 -0400	[thread overview]
Message-ID: <79bfa351ebdb8906c17ec13976aa3e15@ladd.quanstro.net> (raw)
In-Reply-To: <341DF8C2-A223-49A7-AA6C-65B7FB4C1CF5@fastmail.fm>

> % fullloc = '/one/two?three+four'
> % params = `{echo $fullloc | sed -e 's;.*\?;;' -e 's;\+; ;g'}
> % for(param in $params) echo '	<li>'$"param
> 	<li>three
> 	<li>four
>
> The 2nd and 3rd command lines are copied directly from the script, but
> the script itself outputs the following:
>
> 	<li>three four
>
> The sed expressions appear to be working correctly, to my eyes, so I
> don't understand what's going on.

i suspect your ifs is set to something funky.

inserting a "whatis params" in your script would be pretty
interesting.  note that gnu sed will eat your regular expression
since you \? is their meta character.

you can accomplish something that's equivalent in rc without
an explicit loop:

echo '<li>' ^ $params

- erik



  reply	other threads:[~2010-04-03 14:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-03 14:21 Ethan Grammatikidis
2010-04-03 14:38 ` erik quanstrom [this message]
2010-04-03 17:24   ` Ethan Grammatikidis

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=79bfa351ebdb8906c17ec13976aa3e15@ladd.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).