The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 02-02-2007
go4desperado go4desperado is offline
Registered User
  
 

Join Date: Dec 2006
Posts: 7
Question appending to sed output of one file into the middle of file

hi,
i have a file

file1 file2
----------- -----------------
aa bbb ccc 111 1111 1111
ddd eee fff 222 3333 4444
ggg hhh iiii 555 6666 777

i select the portion of file1 as

sed -n '/aa/,/fff/p' file1 ,, this select first two lines of file1,

now i need to append these lines to the middle of file2 ie between line1 and line2

Please help me