rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
From: gjv%atlas%cesar@crbca1.SINet.SLB.COM
To: rc%hawkwind.utcs.toronto.edu%m_internet%m_mailnow%hermes.DECnet@cesar.
	sedalia.sinet.slb.com
Subject: Re:  builtin read
Date: Fri, 17 Sep 1993 09:54:29 -0400	[thread overview]
Message-ID: <9309171358.AA24431@SINet.SLB.COM> (raw)
In-Reply-To: Your message of "Fri, 17 Sep 1993 15:36:01 +0200."


 |I have not decided yet wether a builtin read is a good idea or not.
 |Meanwhile let me help you with this
 |
 |    for( line in `` ($nl) { cat /some/file }){
 |        words = `{ echo $line }
 |    }

Agreed, it looks better than what I came up with, but my objections
remain the same. You still need to fork&exec a cat, and it remains
a bit cludgy IMHO.

 |But I don't understand how your second solution works because there
 |must be something wrong with input redirection. My rc behaves like this:
 |
 |	; while( echo outside ){ echo inside } > /dev/null
 |	outside
 |	outside
 |	..

Oops, typo in my mail I guess, forgot the accolades around the whole
while+body. Applying it to your example, it becomes

	; { while (echo outside) {echo inside}  } > /dev/null

which works as I intended.

I'm not yet convinced though, a builtin read makes the shell more complete
IMHO, not to mention that it would make it easier to pass scripts around.
If someone else wants to use a script of mine, who guarantees that he/she
has an identical read function in his environment, and in case I add a
read function to my script, should I use awk, "sh -c 'read a;echo $a'",
/usr/bin/line, ... ????  And I think that performance is a reasonable
argument here as well.

	Gert-Jan

---------------------------------------------------
J.G. Vons   E-Mail: vons@cesar.crbca1.sinet.slb.com


                 reply	other threads:[~1993-09-17 13:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=9309171358.AA24431@SINet.SLB.COM \
    --to=gjv%atlas%cesar@crbca1.sinet.slb.com \
    --cc=rc%hawkwind.utcs.toronto.edu%m_internet%m_mailnow%hermes.DECnet@cesar.sedalia.sinet.slb.com \
    --cc=vons@cesar.crbca1.sinet.slb.com \
    /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).