9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Friedrich Psiorz <f.psiorz@gmx.de>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] rc and whitespaces
Date: Wed, 26 Nov 2014 14:24:54 +0100	[thread overview]
Message-ID: <5475D4A6.8040007@gmx.de> (raw)
In-Reply-To: <56e1b340c04205d978d0bf01624c79f6@quintile.net>

That behaviour is what I would expect. rc splits text in `{} according
to $ifs, which is usually space, tab, and newline. It doesn't treat any
characters special, including quotes.

Am 26.11.2014 um 14:02 schrieb Steve Simon:
> rc using backquote to parse strings, e.g:
>
> 	hugo% s=`{echo a b c}
> 	hugo% echo $#s $s(1)
> 	3 a
> This is fine
>
> 	hugo% s=`{echo 'a b' c}
> 	hugo% echo $#s $s(1)
> 	3 a
> This is also fine, a b and c are just two fields when they
> enter echo but they leave the appear to be 3 seperate words.
>
> 	hugo% s=`{echo '''a b''' c}
> 	hugo% echo $#s $s(1)
> 	3 'a
> This is disappointing, I was hoping that I would get
> 2 args and the first would be 'a b' (quotes here for
> clarity, I was hoping there would be none in the assinged
> variable $s
>
> Is this what one would expect or is the text parsing
> by `{ .. } different to rc's normal one - dare I say broken.
>
> Is there a way round this?
>
> Thanks,
>
> -Steve
>




  reply	other threads:[~2014-11-26 13:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-26 13:02 Steve Simon
2014-11-26 13:24 ` Friedrich Psiorz [this message]
2014-11-26 13:33   ` 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=5475D4A6.8040007@gmx.de \
    --to=f.psiorz@gmx.de \
    --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).