LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-20-2003, 10:24 AM   #1
shaggz
Member
 
Registered: Dec 2002
Location: FuNkYToWN
Distribution: SuSe, Gentoo, Fedora
Posts: 64

Rep: Reputation: 15
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$
 
Old 11-20-2003, 10:33 AM   #2
Blinker_Fluid
Member
 
Registered: Jul 2003
Location: Clinging to my guns and religion.
Posts: 683

Rep: Reputation: 63
try using the \ before the slashes in your expression
 
Old 11-20-2003, 11:30 AM   #3
shaggz
Member
 
Registered: Dec 2002
Location: FuNkYToWN
Distribution: SuSe, Gentoo, Fedora
Posts: 64

Original Poster
Rep: Reputation: 15
:%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
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Regular expression question gauge73 Linux - General 2 10-28-2005 09:32 AM
Parsing of a simple expression. KissDaFeetOfSean Programming 1 07-18-2005 04:45 PM
regular expression question zero79 Linux - Software 1 07-11-2005 07:03 PM
Regular expression question. groentebroer Programming 2 11-29-2004 09:15 PM
'find' expression question Thorsten Linux - General 3 05-03-2004 07:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration