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 and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Can "sed" substitute word on a specific line? minifish Shell Programming and Scripting 2 02-14-2008 05:25 PM
sed substitute / for \ : error "Function can not be parsed" candyflip2000 Shell Programming and Scripting 3 07-18-2006 04:02 AM
Failed to check status code in "rsh" command nir_s Shell Programming and Scripting 9 07-03-2006 10:05 AM
Failed to replace string with "sed" nir_s Shell Programming and Scripting 7 05-08-2006 05:25 AM
Pattern substitute for "\" ss_hpov Shell Programming and Scripting 3 06-28-2002 09:29 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-02-2005
nir_s nir_s is offline
Registered User
  
 

Join Date: Jun 2004
Posts: 148
Failed to substitute string with "<>"

Hi folks,

I have the following template file:


Code:
application.filePath.core = /core-RIGHTV/Html/
application.filePath.xbip = /xbip-RIGHTV/Html/
translator.rootContext = /translator_<schame_name>/

I need to substitute the string in the third line "<schema_name>" with $SCHEMA_NAME

I ran the following command:

Code:
sed -e 's/<schema_name>/IAS10G/g' application.properties

IAS10G is $SCHEMA_NAME

Nothing was happened.The string was not substituted.

What was wrong?

Thanks in advance,
Nir
  #2 (permalink)  
Old 08-02-2005
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,798
It works perfect.

Am not sure about this, but check your spelling of schema.

See this

Code:
[~/temp]$ echo "translator.rootContext = /translator_<schema_name>/" |  sed -e 's/<schema_name>/IAS10G/g'
translator.rootContext = /translator_IAS10G/

Vino
  #3 (permalink)  
Old 08-02-2005
nir_s nir_s is offline
Registered User
  
 

Join Date: Jun 2004
Posts: 148
Hey vino!

Nice to meet you again here.

Your command with the "echo" works perfect,I agreed.

But I'm running the following:

Code:
platform:/tmp> sed -e 's/<schema_name>/IAS10G/g' application.properties
   application.filePath.core = /core-IAS10G/Html/
   application.filePath.xbip = /xbip-IAS10G/Html/
   translator.rootContext = /translator_<schame_name>/

As you can see ,the string wasn't substituted.

Thanks in advance,

Nir
  #4 (permalink)  
Old 08-02-2005
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,798
True,

Look at the words that are colored.


platform:/tmp> sed -e 's/schema_name>/IAS10G/g' application.properties
application.filePath.core = /core-IAS10G/Html/
application.filePath.xbip = /xbip-IAS10G/Html/
translator.rootContext = /translator_<schame_name>/


With those spelling differences, I dont think sed will work the way you want.

Vino
  #5 (permalink)  
Old 08-02-2005
nir_s nir_s is offline
Registered User
  
 

Join Date: Jun 2004
Posts: 148
Oooooooooooooooooohps.....

Wow!!
Someone wrote by mistake "schame" instead of "schema" in the template file.
I'm going to hit him .....

Thanks again!

Nir
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:55 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0