Hi,
Thank you for your question.
The Unix tool you want to use is tr, short for translate.
tr takes two sets of characters and replaces the first set with the
second set on standard input and sends it to standard output.
For example if you have a file text.txt with
c:\tools\arizona\framework then you would write this:
tr '\\' '/' < text.txt
The output is then:
c:/tools/arizona/framework
This says: look for all backslashes (the first backslash is to escape
the second one) and replace them with forward slashes on standard
input that you're reading from the file text.txt
For more information on tr you can have a look here:
Very short guide to sed, tr, cut and od
http://www.canberra.edu.au/~sam/whp/sed-tricks.html
However what you need to do is summed up in the command line above.
I hope this answers your question. If anything is unclear or you
require any clarifications please do not hesitate to ask.
Thanks.
endo
Search strategy
tr unix
://www.google.com/search?hl=fr&ie=UTF-8&oe=UTF-8&q=tr+unix&lr= |
Request for Answer Clarification by
cheekoo1-ga
on
23 Dec 2003 16:12 PST
endo thanks for the answer, but I need something either in DOS's own
script.I cannot use Perl, or any of the UNIX utilities like tr or
SED,AWK as suggested by you, as I cannot assume their presence on a
particular system.
I have to use this in a makefile where I am getting errors like
D:cvsarznarzn/buildfwrk/src/com/arzoon/util instead of
D:cvs/arzn/arzn/buildfwrk/src/com/arzoon/util. if you can tell me a
way of doing it either in a makefile on WINDOWS or a DOS batch/cmd
file, the answer is yours.
I am trying to do something like
AZN := $(shell perl -e 's/\\/\//gc' $ARZN) , have not succeeded yet ?
|
Clarification of Answer by
endo-ga
on
24 Dec 2003 14:38 PST
Hi,
I'm very sorry about the confusion.
How about using one of these free utilities for DOS? There's a DOS
version of SED on the following page:
TEXT SEARCH and REPLACE
http://members.cox.net/dos/txtms01.htm#textsr
You could include this with your program.
I hope this helps. If it doesn't suit you, please let me know and I'll
do my best to find something that pleases you.
Thanks.
endo
|
Request for Answer Clarification by
cheekoo1-ga
on
27 Dec 2003 12:46 PST
Endo,
Sorry for the belated reply.However, my current implmentation does
not allow me to use anything other than DOS.I already have a
pre-existing framework of shell scripts(DOS on W2k) and (bash on
*nix), so I have to stick to it.
If there was a way of assigning a value from a PERL program into a
DOS variable, maybe that would work too.But I do not know of any.
Something like the DOS equivalent of
ARZN=`perl -e foobar.pl` on UNIX
|
Clarification of Answer by
endo-ga
on
27 Dec 2003 13:13 PST
Hi,
Can you write the value to a file, then read it back again in DOS?
e.g. you could write the Perl result to a ramdisk, or a temp file,
then read it back again.
Thanks.
endo
|
Request for Answer Clarification by
cheekoo1-ga
on
30 Dec 2003 10:05 PST
I can definitely do that ...using echo I believe.
But how could i read it back into a variable in
DOS ? I do not think that it has anything like
"source" in UNIX.
|