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 UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 12-14-2007
shamrock shamrock is offline
Registered User
 

Join Date: Oct 2007
Location: USA
Posts: 585
Quote:
Originally Posted by burakkilic View Post
Hi. I have some questions about using sed. I cannot use the hold buffer. For example i want to put first line to the buffer than take second line and append the buffer to the second line.then 3th to the all. It will be like 2->1->3 th lines. Any idea?
Code:
sed -n '1,2{h
n
G
p
}
3,$p' file
Reply With Quote