> I need to write a script to replace '\'s with '/', but how can I get
> grep to accept '\' as a regular expression (it assumes it to be line
> continue character, at least from the sh prompt)?

Come to think of it, if you're trying to _replace_ charcacters, instead
of just locating them, you might want to try the tr command:

        cat file |tr '\\' '/' >outfile

This commandline feeds file into the 'tr' command, which here is told to
replace backslashes (note that here too, you must use '\\') with
slashes, and then sends the output to outfile.  Check out the man page
for 'tr'.

If backslashes will only appear in file paths, you are set.  If they
appear in some other contents where they need to be kept, then look at a
more sophisticated tool like sed.

Reply via email to