1.

Solve : Why Extra back \\?

Answer»

I use IE8 and WIN7. Why is an EXTRA \\ backslash added for each \\ ?

Only ONE \\ backslash each time.

type cntstr.bat
rem @echo off
sed s/%1/%1\\n/g %2 | egrep -c %1

cntstr.bat 22 yr2010.doc

rem @echo off

sed s/22/22\\\\n/g yr2010.doc | egrep -c 22
12Only one \\ with original.

Maybe this will explain

http://stackoverflow.com/questions/2369314/why-does-sed-require-3-backslashes-for-a-regular-backslashQuote from: victoria on August 08, 2010, 11:18:51 AM

I use IE8 and Win7. Why is an extra ^\\ backslash added for each ^\\ ?

Only one ^\\ backslash each time.

type cntstr.bat
rem @echo off
sed s/%1/%1^\\n/g %2 | egrep -c %1

cntstr.bat 22 yr2010.doc

rem @echo off

sed s/22/22^\\n/g yr2010.doc | egrep -c 22
12
^\\Locking this moronic thread.


Discussion

No Comment Found