sed, awk, or something...help meeeeeeeeeee

Kanwar Ranbir Sandhu m3freak at thesandhufamily.ca
Tue Sep 29 12:39:28 UTC 2009


On Mon, 2009-09-28 at 20:07 +0100, Sharpe, Sam J wrote:
> That alone doesn't fit your original specification:
> 
> [sam at samlap Desktop]$ sed -e '/BB/R file2' file1
> AA
> BB
> BBBB1
> CC
> DD
> 
> AA
> BB
> BBBB2
> CC
> DD
> 
> You specified that BB was to be /replaced/ with BBBB1, so you will
> need to do this:
> 
> [sam at samlap Desktop]$ sed -e '/BB/R file2' -e '/BB/d' file1
> AA
> BBBB1
> CC
> DD
> 
> AA
> BBBB2
> CC
> DD

My bad - I meant to say "insert" not replace because I had another
version of the that doesn't have "BB" in it.

Thanks for pointing it out to me, though.

Regards,

Ranbir

-- 
Kanwar Ranbir Sandhu
Linux 2.6.27.30-170.2.82.fc10.x86_64 x86_64 GNU/Linux 
08:36:24 up 9 days, 22:11, 2 users, load average: 0.16, 0.12, 0.08 





More information about the users mailing list