The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 04-19-2007
anbu23 anbu23 is offline
Registered User
 

Join Date: Mar 2006
Location: Bangalore,India
Posts: 1,397
Quote:
Originally Posted by cursive
Hi,

Abou the code : sed -n "/^[^)]*([^)]*$/,/^[^(]*)[^(]*/p" file
the system prompt error message, "Illegal variable name"

I am not sure whether I missing something here, could someone
show me the right path ?

Thanks in advance,
cursive
Try using single quotes
Code:
$ cat file
statement statement statement
statement statement statement
statement statement statement

Today( "here"

MONDAY = map( "monday")
TUESDAY = map( "tuesday" )

WESNESDAY = map( "wednesday" )
THURSDAY = map( "thursday" )
FRIDAY = map( "friday" )

SATURDAY = map( "saturday" )
SUNDAY = map( "sunday" )

);

statement statement statement
statement statement statement
statement statement statement
$ sed -n '/^[^)]*([^)]*$/,/^[^(]*)[^(]*/p' file
Today( "here"

MONDAY = map( "monday")
TUESDAY = map( "tuesday" )

WESNESDAY = map( "wednesday" )
THURSDAY = map( "thursday" )
FRIDAY = map( "friday" )

SATURDAY = map( "saturday" )
SUNDAY = map( "sunday" )

);
Reply With Quote