LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Simple expression question (https://www.linuxquestions.org/questions/linux-general-1/simple-expression-question-118176/)

shaggz 11-20-2003 10:24 AM

Simple expression question
 
I've been messing with this for about an hour now and I know it is so simple but I can't find the right syntax.



I have a 1000+ line file with multiple path references such as /opt/www/html/images

The issue is I have multiple subdirectories within html that need to reference the images directory relatively by ../images or ../../images


I want to use VI to do a global replace however it does not like the extra slash

eg. %s/images/../images/g
Error Trailing Characters


Can someone tell me how to fix this. I have tried using "quotes" and 'literals' however with no success. I'm still learning so thanks for the help


: > window$

Blinker_Fluid 11-20-2003 10:33 AM

try using the \ before the slashes in your expression

shaggz 11-20-2003 11:30 AM

:%s/\images/..\/images


The above worked thanks!. I knew it was simple I was trying to put the \ before the .. so that it didn't like.


Thanks again


All times are GMT -5. The time now is 11:47 PM.