Click to See Complete Forum and Search --> : fromdos script?


Energon
10-29-2001, 03:11 PM
I've got some source files that I'm working with in both Windows and Linux, and because of the nature of MSVC, I have to convert the files to/fromdos format before I can work with them properly... but as far as I know, I can't just fromdos < *.cpp > *.cpp (or maybe I can?), is there an easy way in a bash script to do this? Or should I just be brave and try it with globbing?

jemfinch
10-29-2001, 06:59 PM
perl -pi -e 's/\r\n/\n/' *.cpp

Jeremy

Energon
10-30-2001, 12:00 AM
ahhh... cool... thank you... and I can just switch the replacements to go the other way... very cool...

But will it mess with any \n I have in an output string, etc?

iDxMan
10-30-2001, 12:16 AM
No it should be fine..

Although : perl -pi -e 's/\\n//g' *.cpp

might do a bit of harm.