Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!apple!rutgers!pyrnj!pyrdc!uunet!mcvax!hp4nl!philmds!leo
From: leo@philmds.UUCP (Leo de Wit)
Newsgroups: comp.lang.c++
Subject: Re: "cut" needed to run CC
Message-ID: <817@philmds.UUCP>
Date: 23 Sep 88 20:54:27 GMT
References: <990@acornrc.UUCP> <486@poseidon.UUCP> <911@riddle.UUCP> <809@philmds.UUCP> <25047@bu-cs.BU.EDU>
Reply-To: leo@philmds.UUCP (Leo de Wit)
Organization: Philips I&E DTS Eindhoven
Lines: 28

In article <25047@bu-cs.BU.EDU> tower@bu-it.bu.edu (Leonard H. Tower Jr.) writes:
|In article <809@philmds.UUCP> leo@philmds.UUCP (Leo de Wit) writes:
||In article <911@riddle.UUCP> domo@riddle.UUCP (Dominic Dunlop) writes:
|| ...  ...
|
|This shell script does the job:
|
|while read c1 c2 c3 c4
|do
|	echo $c1 $c3
|done
|
|As it only uses built-ins, it will scream along fine.  

While read is a builtin for the Bourne shell, echo isn't (at least not
on Ultrix).
The opposite goes for the csh (although it has a notion of $< or
something, but I'm too unfamiliar with csh to know whether this can be
used to read separate words in a line, like read).
What shell are you referring to? The syntax is Bournish.

Even if your shell has both builtin, I doubt it can beat sed. Firing up
sed took about 0.5 sec, which is less than 5% of the time it took to
process the lot. Then it can run along real fast, since sed is designed
for text processing, the shell not. Maybe you can come up with some
facts and figures - I did too.

                            Leo.