[comp.unix.questions] ed script

ade@clark.uucp (Adrian Miranda) (06/30/90)

My apologies if this is obvious, I don't know anything about ed, and
really don't want to 8-).

Could someone tell me how to write an ed script that will read in a
file, find the line containing a ')', delete all lines which follow,
then append another file to what remains of the first?  I'm afraid it
does have to be ed, it will go on a boot floppy that doesn't have room
for much else.

Please mail it to me, this is unlikely to appeal to anyone else.

Adrian Miranda
uunet!clark!ade

eli@panda.uucp (Eli Taub/100000) (07/03/90)

In article <1990Jun30.060610.9287@clark.uucp> ade@clark.uucp (Adrian Miranda) writes:
>My apologies if this is obvious, I don't know anything about ed, and
>really don't want to 8-).
>
>Could someone tell me how to write an ed script that will read in a
>file, find the line containing a ')', delete all lines which follow,
>then append another file to what remains of the first?  I'm afraid it
>does have to be ed, it will go on a boot floppy that doesn't have room
>for much else.
>
>Please mail it to me, this is unlikely to appeal to anyone else.

Sorry, I don't think I can email anything...

>
>Adrian Miranda
>uunet!clark!ade

The following lines should do the trick:

r file1
/)/+1,$d
r file2
w
q
                                                           _   |___      
Eli Taub                                                    |     |   \  |
(512) 838-4810                                                    |   /\/
Contractor at (AWD) IBM  | I express my apinions not IBM's.      /   |  \