If you use BBEdit this isn't a big deal, but I use pico a lot for quick edits of files, and a lot of our developers use Windows to edit the files, so the linebreaks are different, which causes pico (or any Unix editor) to open the file all on one line with no line breaks.
A quick, one line way to convert from windows to unix is at the terminal prompt is to type:
tr '\n' '\r' < /path/to/winfile > /path/to/macfile
I usually create two scripts in my /bin folder called "demac" and "tomac". They actually create a backup copy just in case, and then make the new file the same name as the old. you can copy and past the following into Pico and save them:
demac (to convert from mac to windows):
#!/bin/sh
tr '\r' '\n' < $1 > temp
mv $1 $1.bak
mv temp $1
tomac (to convert from windows to mac):
#!/bin/sh
tr '\n' '\r' < $1 > temp
mv $1 $1.bak
mv temp $1
I then type "demac filename" or "tomac filename" and the original is stored as "filename.bak" just in case
A quick, one line way to convert from windows to unix is at the terminal prompt is to type:
tr '\n' '\r' < /path/to/winfile > /path/to/macfile
I usually create two scripts in my /bin folder called "demac" and "tomac". They actually create a backup copy just in case, and then make the new file the same name as the old. you can copy and past the following into Pico and save them:
demac (to convert from mac to windows):
#!/bin/sh
tr '\r' '\n' < $1 > temp
mv $1 $1.bak
mv temp $1
tomac (to convert from windows to mac):
#!/bin/sh
tr '\n' '\r' < $1 > temp
mv $1 $1.bak
mv temp $1
I then type "demac filename" or "tomac filename" and the original is stored as "filename.bak" just in case