Re: How to convert files
John Hasler wrote:
> Luis Ariel Lecca writes:
> > Im trying to find a good way to convert dos files (CR-LF) to Unix files
> > (LF). This should be safe and recursive but it should not change any
> > binary file.
> Write script using find to recurse, file to detect binaries, and dos2unix
> to convert text files.
I'm not clear how to use command file to detect binaries.
$ file aaa.sh
aaa.sh: Bourne shell script text executable
$ file aaa.py
aaa.py: python script text executable
$ file /etc/passwd
/etc/passwd: ASCII text
Obviousely, each of the outputs above has string 'text' in it.
But I'm not sure of the cases of other kinds of textfiles.
> > The files arent large but there are millon.
> You may need xargs, then.
> > I couldnt find it on debian Sarge 3.1r2 ( apt-cache search dos2unix )
> apt-get install tofrodos
> John Hasler