Replacing a regex on a one line expression

T

TLOlczyk

In a makefile, I had the following line:The problem came when I tried this in Windows.
Then the variable of PERLINCDIR is;
c:\dir1\dir2/CORE.
From error messages I guess the \ and / confuses the compiler.
So I want to replace all the \ with / ( something I do routinely in
Windows precisely for this reason ).
Obviously the regex operation to do this is:
s:\\:/:g
The question is how to use this regex op.
I tried:No go.
I've also triedthe result is an error "near my lo".

I've tried s:\\\\:/:g
I've tried my \$tlo, my \\$tlo etc.
all with no luck. Suggestions?


The reply-to email address is (e-mail address removed).
This is an address I ignore.
To reply via email, remove 2002 and change yahoo to
interaccess,

**
Thaddeus L. Olczyk, PhD

There is a difference between
*thinking* you know something,
and *knowing* you know something.
 
B

Ben Morrow

In a makefile, I had the following line:
The problem came when I tried this in Windows.
Then the variable of PERLINCDIR is;
c:\dir1\dir2/CORE.
From error messages I guess the \ and / confuses the compiler.
So I want to replace all the \ with / ( something I do routinely in
Windows precisely for this reason ).
Obviously the regex operation to do this is:
s:\\:/:g
The question is how to use this regex op.
I tried:
No go.
I've also tried
the result is an error "near my lo".

So... make is removing $t. This is what make does... to escape the $,
use $$. Also, for a one-liner I would use $_ (untested: you may need
s:\\\\:; ignore line-wrapping):

PERLINCDIR := $(shell perl -MConfig -e'$$_="$$Config{archlib}/CORE";
s:\\:/:g; print')

Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top