The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Why is my buffer empty in vi? cookiebooy UNIX for Dummies Questions & Answers 2 10-28-2007 01:17 PM
Buffer Cache ALTRUNVRSOFLN HP-UX 1 04-02-2005 06:43 PM
buffer question lmanchur. UNIX for Dummies Questions & Answers 4 12-14-2004 06:11 PM
buffer the output collins High Level Programming 6 11-08-2004 10:57 PM
About Buffer Niko UNIX for Advanced & Expert Users 1 09-18-2001 12:49 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-14-2007
Registered User
 

Join Date: May 2006
Posts: 6
Using sed buffer

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?
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 12-14-2007
Registered User
 

Join Date: Oct 2007
Location: USA
Posts: 497
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
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:00 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0