Tool to change \ to /

Hi
I wasn't sure whether to post this here or under linux programming
but since it doesn't really have anything to do with c++ i just posted it here. sorry if its wrong.

basically: i have this codebase where i used "\" in all my include paths and now i need to build it on linux...which is a problem because apparently on linux you use / for filepaths

so i was just wondering: does anyone know of a tool that can autoamtically go through all my sourcefiles and change the the backslashes to forwardslashes?

thanks :)
Last edited on
Untested, but in bash, something like this?
find . \( -name '*.cpp' -o -name '*.h' \) -exec sed -i '/^#include/ s/\\/\//g' {} \;
Last edited on
This issue is a good reason to always use the forward solidus ( / ) as a path separator, even on Windows.
It's also illustrative of a good reason to learn the command line.
Why don't you write a little tool yourself ?
Should be simple and straightforward.
Topic archived. No new replies allowed.