9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Mack Wallace <mackbw@mapinternet.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] How does one read a file line by line in an rc script?
Date: Sat,  5 Jan 2019 19:33:50 -0500	[thread overview]
Message-ID: <E13502C9-4341-482C-B284-05A38AA9FFCC@mapinternet.com> (raw)
In-Reply-To: <ffc0add4039f6954c921f444b2af2ccd@quintile.net>

Thanks...


I'm running Bell Labs Plan 9 in Virtualbox. (I’m not sure how to get the version from the os or from rc)

I copied and pasted the snip directly into a script with only that in it - same error as before:“rc (testread): variable name not singleton!”

As for the second part - I will move that to the other thread. There are now some things I’m exploring there with the ifs variable, (which I thought the ifs variable was limited in plan 9 from what I read). 

Mack
 

> On Jan 5, 2019, at 6:46 PM, Steve Simon <steve@quintile.net> wrote:
> 
> What are you running this on, is this byron's rc on unix?
> 
> I just tried the secript I posted, cut and pasted into a
> tiny shell scropt called testread, and it just worked™
> 
> maybe some other part of your script has a problem?
> 
> My script below
> -----snip-----snip-----
> #!/bin/rc
> 
> cat $1 | while(line=`{read}){
> echo $line
> }
> 
> -----snip-----snip-----
> 
> 
> Also, I didn't have the time to read all of your previous question,
> but I think what you are after is $"varname, this expands to the value
> of the variable but as a single argument, no matter if it, when
> it was assigned, had multiple, white space seperated words in it.
> 
> for example:  (NB: hugo% is my prompt)
> 
> 	hugo% fred=(a b c d)
> 
> 	hugo% echo $fred^-letter
> 	a-letter b-letter c-letter d-letter
> 
> 	hugo% echo $"fred^-letter
> 	a b c d-letter
> 
> -Steve
> 
> 




  reply	other threads:[~2019-01-06  0:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-05 22:34 Mack Wallace
2019-01-05 22:45 ` Steve Simon
2019-01-05 23:28   ` Mack Wallace
2019-01-05 23:46     ` Steve Simon
2019-01-06  0:33       ` Mack Wallace [this message]
2019-01-06  0:03 ` Anthony Martin

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=E13502C9-4341-482C-B284-05A38AA9FFCC@mapinternet.com \
    --to=mackbw@mapinternet.com \
    --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).