Yea, this is easy, IF you use SED much.
With cygwin installed, SED, the stream editor is available. In a command shell, execute:
Explanation
- set path will print the Windows path. File path entries are separated by “;”.
- sed will invoke the cygwin installed linux SED command. Cygwin\bin is part of the executable path.
- “s” indicates the substitute command
- “_”, the underscore is used as the delimiter to each part of the substitution.
- “;” is the regular expression to use for a match.
- “;\n” is the string to substitute with.
- “g” is the substitute flag, global replacement
No doubt there are more direct ways of doing this. Using PowerShell would be the most appropriate if it is available.
Example
If your path is: C:\fee;d:\fi;c:\foo;\fum
The result would be:
C:\fee;
d:\fi;
c:\foo;
\fum
References
GNU sed
Sed – An Introduction and Tutorial by Bruce Barnett
SED, stream editor
David Darling – Cycle One: Namaste!
Posted by josefB 