question about awk or sed

question about awk or sed

Post by SW US » Mon, 04 Dec 2000 04:00:00



M: I'm sure this is a simple question for some, but i've come a
long way in teaching myself how to do shell script programming.  
anyway, i need some hints on how to get started on this
problem.  maybe a nice little piece of code i can play with it
as i learn.

fromthe command prompt, using a shell script, i want to take an
existing plain html text file, read down to a certain point
where i would have placed a marker (something like ,
then insert another file right beneath that marker.

i have a tiny bit of experience with awk, but never used sed.  i
was thinking this might be a job for sed.  i don't know.  any
suggestions?  can you email me direct?  thanks!  -chas

http://www.recycles.org/

S: Sent

 
 
 

question about awk or sed

Post by Barry Margoli » Tue, 05 Dec 2000 04:00:00




Quote:>M: I'm sure this is a simple question for some, but i've come a
>long way in teaching myself how to do shell script programming.  
>anyway, i need some hints on how to get started on this
>problem.  maybe a nice little piece of code i can play with it
>as i learn.

>fromthe command prompt, using a shell script, i want to take an
>existing plain html text file, read down to a certain point
>where i would have placed a marker (something like ,

Something like what?  I don't see anything there.

Quote:>then insert another file right beneath that marker.

>i have a tiny bit of experience with awk, but never used sed.  i
>was thinking this might be a job for sed.  i don't know.  any
>suggestions?  can you email me direct?  thanks!  -chas

(sed '/marker/q' firstfile; cat otherfile; (sed '/marker/,$p' firstfile |
tail +2)) > newfile

--

Genuity, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.