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
help me in sending parameters from sqlplus script to unix shell script Hara Shell Programming and Scripting 2 01-29-2008 12:31 PM
Shell Script: want to insert values in database when update script runs ring Shell Programming and Scripting 1 10-25-2007 12:06 AM
here document to automate perl script that call script hogger84 Shell Programming and Scripting 3 10-22-2007 07:15 AM
returning to the parent shell after invoking a script within a script gurukottur Shell Programming and Scripting 5 09-26-2006 04:05 AM
return valuse from child script to parent script borncrazy Shell Programming and Scripting 1 08-20-2004 12:39 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 08-15-2006
Registered User
 

Join Date: Aug 2006
Posts: 18
sed script

how to convert the follow sed script file into a command line ?

example:
/^\.TS/,/^\.TE/{
/^$/p
}


I have tried the below but it is not working:
# sed -n "/^\.TS/,/^\.TE/{/^$/p}" file

file:
111
.TS
222
$333 << extract this line
444
.TE
555

please help, any thanks !

Last edited by 3Gmobile; 08-15-2006 at 08:44 AM.
Reply With Quote
Forum Sponsor
  #2  
Old 08-15-2006
Ygor's Avatar
Moderator
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,249
Use single quotes and escape the dollar sign...
Code:
sed -n '/^\.TS/,/^\.TE/{/^\$/p}' file
Reply With Quote
  #3  
Old 08-16-2006
aigles's Avatar
Registered User
 

Join Date: Apr 2004
Location: Bordeaux, France
Posts: 1,212
Code:
sed -n '/^\.TS/,/^\.TE/{/^\$/p;}' file
Jean-Pierre.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 11:16 PM.


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

Content Relevant URLs by vBSEO 3.2.0