From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mack Wallace Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.1 \(3445.101.1\)) Date: Sat, 5 Jan 2019 19:33:50 -0500 References: To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> In-Reply-To: Message-Id: Subject: Re: [9fans] How does one read a file line by line in an rc script? Topicbox-Message-UUID: f2b1b744-ead9-11e9-9d60-3106f5b1d025 Thanks... I'm running Bell Labs Plan 9 in Virtualbox. (I=E2=80=99m 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:=E2=80=9Crc (testread): variable name not = singleton!=E2=80=9D As for the second part - I will move that to the other thread. There are = now some things I=E2=80=99m exploring there with the ifs variable, = (which I thought the ifs variable was limited in plan 9 from what I = read).=20 Mack =20 > On Jan 5, 2019, at 6:46 PM, Steve Simon wrote: >=20 > What are you running this on, is this byron's rc on unix? >=20 > I just tried the secript I posted, cut and pasted into a > tiny shell scropt called testread, and it just worked=E2=84=A2 >=20 > maybe some other part of your script has a problem? >=20 > My script below > -----snip-----snip----- > #!/bin/rc >=20 > cat $1 | while(line=3D`{read}){ > echo $line > } >=20 > -----snip-----snip----- >=20 >=20 > 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. >=20 > for example: (NB: hugo% is my prompt) >=20 > hugo% fred=3D(a b c d) >=20 > hugo% echo $fred^-letter > a-letter b-letter c-letter d-letter >=20 > hugo% echo $"fred^-letter > a b c d-letter >=20 > -Steve >=20 >=20