From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mack Wallace Content-Type: multipart/alternative; boundary="Apple-Mail=_93145BC2-FD63-4F53-909B-88A62C5E490F" Mime-Version: 1.0 (Mac OS X Mail 12.1 \(3445.101.1\)) Message-Id: <6A2B4894-94A0-430A-9A17-84A37F1B4BD6@mapinternet.com> Date: Sat, 5 Jan 2019 17:34:17 -0500 To: 9fans@9fans.net Subject: [9fans] How does one read a file line by line in an rc script? Topicbox-Message-UUID: f28f33f4-ead9-11e9-9d60-3106f5b1d025 --Apple-Mail=_93145BC2-FD63-4F53-909B-88A62C5E490F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Another, probably more stupid question - How does one read a text file = line by line in an rc script. In bash this works: #!/bin/bash =20 while read line =20 do =20 echo $line =20 done < $1=20 I=E2=80=99ve tried: #!/bin/rc =20 while (line=3D`{read $1}) =20 { echo $line =20 }=20 Which produces the first line of the file in an infinite loop. I=E2=80=99v= e tried the -m argument with no output. It=E2=80=99s probably simple, but just can=E2=80=99t seem to find the = equivalent. Regards, Mack --Apple-Mail=_93145BC2-FD63-4F53-909B-88A62C5E490F Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Another, probably more stupid question - How does one read a = text file line by line in an rc script.

In bash this works:

#!/bin/bash  

while read line  
do  
echo $line  
done < $1 

I=E2=80=99ve tried:

#!/bin/rc  

while = (line=3D`{read $1})  
{
echo $line =  

Which produces the = first line of the file in an infinite loop. I=E2=80=99ve tried the -m = argument with no output.


It=E2=80=99s probably = simple, but just can=E2=80=99t seem to find the equivalent.

Regards,

Mack



= --Apple-Mail=_93145BC2-FD63-4F53-909B-88A62C5E490F--