1. Program: sed for dos
2. Files that need replacement: tool.ini,template.ini
3. Replace the string _SETPATH with the current path %CD%
4. Wrong command line: sed -i 's/_SETPATH/%CD%/g' tool.ini
5. Reason: it contains the % sign
6. It should probably work with: sed -i 's/_SETPATH/$CD/g' tool.ini
How can I make $CD equal to the current path specified by %CD% under DOS?
Can it replace multiple files in different paths at the same time?
Please advise, thanks.
sed -i "s/_SETPATH/%CD%/g" tool.ini
The result can be replaced, but the \ in the DOS path gets deleted
The result I get is c:windowssystem32
not the c:\windows\system32 that I want
How can this be solved》???
[ Last edited by axolo on 2007-10-30 at 08:36 PM ]
2. Files that need replacement: tool.ini,template.ini
3. Replace the string _SETPATH with the current path %CD%
4. Wrong command line: sed -i 's/_SETPATH/%CD%/g' tool.ini
5. Reason: it contains the % sign
6. It should probably work with: sed -i 's/_SETPATH/$CD/g' tool.ini
How can I make $CD equal to the current path specified by %CD% under DOS?
Can it replace multiple files in different paths at the same time?
Please advise, thanks.
sed -i "s/_SETPATH/%CD%/g" tool.ini
The result can be replaced, but the \ in the DOS path gets deleted
The result I get is c:windowssystem32
not the c:\windows\system32 that I want
How can this be solved》???
[ Last edited by axolo on 2007-10-30 at 08:36 PM ]
