C:\temp I want the value of C:\temp be...">

Character escape>

I have a text file whose contents are <rapidwizloc oa_var="s_rapidwizloc">C:\temp</rapidwizloc>

I want the value of C:\temp be replaced with another value that is determined from the variable

Also perl oneliner is called from a batch file (windows.cmd)

 set CMDDIR=C:temp1 set str1=C:temp echo %CMDDIR% echo %str1% 

perl -pi.bak -e "s/s_rapidwizloc\"\>%str1%/s_rapidwizloc\"\>%CMDDIR%/g" a.txt

when running .cmd I get

Incorrect file name, directory name, or volume name.

+4
source share
1 answer

To avoid the > character in Windows batch files, use circumflex, thus ^> .

+3
source

Source: https://habr.com/ru/post/1497520/


All Articles