From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: [9fans] rc niggle, and proposed fix
Date: Mon, 20 Jun 2011 15:48:19 -0400 [thread overview]
Message-ID: <e80a8eedbc8aa7f3bc9ccdbdf9870d51@ladd.quanstro.net> (raw)
ifs seems a holdover. it's only ever used in `{} yet
it's a global inherited variable. so it's easy to write
a script that assumes that ifs is set to the default.
a seemingly useful way to use ifs is as a local. one
would think
ifs=burble fu=`{bar}
would be sensible, but unfortunately this is doubly
wrong. the assignments aren't local since there is
no command, just assignments. this could be fixed by
ifs=burble {fu=`{bar}}
but if bar is a script and isn't quite careful about
setting ifs before using it, bar will produce surprises.
it seems to me the easiest way to fix this is to introduce
a new form of `{} that allows the splitting characters
to be specified without fidding ifs, so
fu=`burble {bar}
(fortunately rc didn't adopt byron's `word form.)
this has the advantage of not breaking anything while
still allowing one to write scripts more precisely.
the code is contrib quanstro/rchistory. enjoy.
- erik
next reply other threads:[~2011-06-20 19:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-20 19:48 erik quanstrom [this message]
2011-06-22 16:02 ` Charles Forsyth
2011-06-22 16:21 ` 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=e80a8eedbc8aa7f3bc9ccdbdf9870d51@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).