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
rsh to change multiple ip in multiple servers? kenshinhimura Shell Programming and Scripting 2 02-18-2008 03:04 AM
About NIMs Mustur007 AIX 1 08-14-2007 05:06 PM
Career Path/Change - Cert Help CoopDeVille What's on Your Mind? 2 06-15-2007 09:41 PM
Change Default Path ? tkbharani UNIX for Advanced & Expert Users 4 01-14-2007 03:53 AM
How to loop thru and change multiple files in realtime system? merliech Shell Programming and Scripting 2 04-25-2006 01:25 AM

 
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
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 03-22-2007
get_chandrakant get_chandrakant is offline
Registered User
  
 

Join Date: Mar 2007
Posts: 8
to change a path /appl/nims with an /appl2/nimsrobt in multiple files using sed

Hi All,

I have developed a script in which i have taken the path from the user in a variables named FromPath and ToPath.

I want to replace the FromPath with ToPath. For that I am using sed command in the following way.

cp $file bk_$file

FromPath=/appl/nims/nimsc1

FromPath=`echo $FromPath | sed 's/\//\\//g'

It should return \/appl\/nims\/nimsc1 to use it in SED command.

sed 's/$FromPath/$ToPath/g' bk_$file > $file


But it is not working and it is raising an error command garbled.

It is working fine on the unix prompt. but in script it is raising an error.

So please co-operate me and tell me what wrong I am doing.
 

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:14 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