At 9:31 PM -0400 4/20/06, Timothy Driscoll wrote:
I need to ensure that a whole bunch of files use unix line endings and not Mac. I have been doing this one file at a time in BBEdit, but I have a lot of files. can anyone recommend a batch process? almost anything will do - script, software, Automator, ...

tr(1) will do a single file

        tr "\r" "\n" < in > out

...but since it does stdin to stdout, you'll need to write a temp file and then mv it back.

How you feed tr depends on your requirements. find(1) is useful, or in a shell script, something like

        for file in *; do
                tr "\r" "\n"  < $file > /tmp/trtmp
                mv /tmp/trtmp $file
        done

...will, for example, convert all the files in the current directory. It won't preserve ownership and permissions, though.
--
/Jonathan Lundell.

--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to:  <[EMAIL PROTECTED]>

Reply via email to