Search Results

Search: Posts Made By: c00lsnoopy
2,160
Posted By raghu_shekar
Try this
in the vi mode, type : then the below line. If you have multiple lines with usr/home which needs to be changed, use g at the end else just skip it.
this should work fine.
...
2,160
Posted By thegeek
when you use / as delimiter then you have to...
when you use / as delimiter then you have to properly escape the / that occurs in your pattern, or else use some other delimiter other than /.


Removed Self Promoting Links
2,160
Posted By denn
put cursor on the line you want to change and...
put cursor on the line you want to change and type



:%s=/home/user1/bin/=/root/bin

## if you want to globally change
:%s=/home/user1/bin/=/root/bin=g
2,160
Posted By durden_tyler
$ $ X="/home/user1/bin/" $ $ echo $X ...
$
$ X="/home/user1/bin/"
$
$ echo $X
/home/user1/bin/
$
$ echo $X | sed -e 's/\/home\/user1/\/root/' -e 's/\/$//'
/root/bin
$
$


tyler_durden

---------- Post updated 06-23-10 at...
Showing results 1 to 4 of 4

 
All times are GMT -4. The time now is 06:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy