From: Steve Simon <steve@quintile.net>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] pass list from Rc to awk (p9p vs plan9)
Date: Fri, 17 Aug 2018 13:45:34 +0100 [thread overview]
Message-ID: <2B69D099-A715-4052-8BAB-A3FA746B729A@quintile.net> (raw)
In-Reply-To: <CAJUT6o6zHfhfe3k2kWhJ9htVOFVGXRkCsjTfKB+YrUgKWGEi8w@mail.gmail.com>
cunning.
i have never used ENVIRON, using -v instead but this can cause escaping problems. this is a nice solution.
-Steve
> On 17 Aug 2018, at 09:27, dexen deVries <dexen.devries@gmail.com> wrote:
>
> mental note, as it took me a second to put it together:
>
> #!/usr/bin/env rc
>
> flag e +
>
> myList = ( aa bb cc)
>
> awk '
> BEGIN {
> split(ENVIRON["myList"], myList, "\001") # "\000" on plan9 proper
> for (n in myList)
> print n, myList[n]
> }
> '
>
prev parent reply other threads:[~2018-08-17 12:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-17 8:27 dexen deVries
2018-08-17 12:45 ` Steve Simon [this message]
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=2B69D099-A715-4052-8BAB-A3FA746B729A@quintile.net \
--to=steve@quintile.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).