sed

Associate
Joined
1 Aug 2003
Posts
1,053
I'm trying to use sed, but like many before me my brain is melting.

Could someone tell me how I can get sed to do a global substitution function where it will substitute data from elsewhere in the stream.

i.e. there's a date at the top of the file (sic) 10-Feb-09 and I want that inserted at the begining of each line excluding the first 16 lines so...


sed '1,16!s/^/????/g'


where ???? = the expression I don't know

Can I refer to it by pattern or line or similar?
 
Back
Top Bottom