-   Linux - Newbie (
-   -   convert DOS style (

nardo 05-20-2011 01:07 PM

convert DOS style
How do I write a script to convert all DOS style backslashes to UNIX style slashes in a list of files /

corp769 05-20-2011 01:42 PM


I have found a thread similar to this, locate here:

Hope that helps man!



spazticclown 05-20-2011 02:30 PM

Using the slashes in the sed command can be confusing.


sed 's#\\#\/#g' < filename.txt
In this example instead of using '\' as the separator between sed fields I used '#' to make it more readable, I also escaped the '/' and '\' just to be sure it knew what to do. What it does is substitute '\' with '/' and then 'g' for global in the stream (in this case filename.txt).

MTK358 05-20-2011 02:48 PM

There's no need to escape the forward-slash is you use a different delimiter.

All times are GMT -5. The time now is 04:32 PM.