![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| replacing string in an XML file | subin_bala | Shell Programming and Scripting | 2 | 06-03-2008 07:14 AM |
| Replacing Last occurance of & from a string | vivekshady | Shell Programming and Scripting | 1 | 05-13-2008 08:15 PM |
| Replacing string in files | mohan705 | Shell Programming and Scripting | 2 | 08-29-2007 01:27 AM |
| Problem replacing the string | Viken | Shell Programming and Scripting | 2 | 03-18-2007 06:38 PM |
| string replacing | priya_9patil | Shell Programming and Scripting | 1 | 11-03-2006 12:05 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi,
I have a file with the path of the directory present somewhere in it.I have assigned the path of the directory name to a variable. I want to replace it with another string.The code i used was sed -e '/$variable/sbcd/' filename. since the path name includes slashes '/', my sed command is not working. How to solve this out to replace the path name with another string. |
|
||||
|
Hi,
How do i replace one variable with another variable? for e.g inp1=ab inp2=cd how do i replace $inp1 with $inp2? And how do i replace a string with a variable? Can you please help?I am stuck here. |
|
||||
|
Can you please make the question more clear ?
|
|
||||
|
Quote:
as i got your question it is a easy task to do just do Code:
$inp1=$inp2 or $inp2=$inp1 |
|
||||
|
Buddy,
As my friend Dileep has correctly pointed out, your question seems to be confusing. As per my understanding, "how do i replace $inp1 with $inp2?" means u want to swap the values of the two variables, is it? If yes then use one more variable and u can easily swap the values stored in the variables. Replacing a string with a variable means you want to assign a variable to another variable rather then assigning it to some string,rite? If so den u can do it d same way as u do for string. But here the variable needs to have some value stored in it. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|