Recursive dos2unix
Following command helped in converting more than 10000 windows formated xml and other files to unix. that too in very short time span.
$ find . -name *.* -exec dis2unix {} \;
14 Comments »
Leave a Reply
-
Recent
-
Links
-
Archives
- September 2009 (1)
- October 2008 (1)
- August 2007 (2)
- April 2007 (1)
- October 2006 (1)
- September 2006 (4)
- August 2006 (1)
- July 2006 (5)
-
Categories
-
RSS
Entries RSS
Comments RSS
Thanks for this, I used a modified version to convert a bunch of .cpp and .h files. Very useful.
This thing helps me.
yc
Your one doesn’t work for me, I got this error:
find: paths must precede expression
Usage: find [-H] [-L] [-P] [path...] [expression]
Instead, this one works well: find . -type f -exec dos2unix {} \;
Worked for me, thanks Eric
Didn’t really work very well for me. I used the following command instead:
$ dos2unix `find ./ -type f`
(note that it’s backtick (`) and not single quote (‘))
Abhiram: “argument list too long”.
Looks like Eric Lin’s thing works ok.
Khaos: It works fine for me but Eric’s doesn’t. Maybe it is specific to my setup.
if is argument list too long use it with xarg command
[...] After trying to do a recursive dos2unix call, as detailed in the following blog post: http://cyberzen.wordpress.com/2006/07/15/recursive-dos2unix/ [...]
Pingback by find: paths must precede expression « Aaron’s Blog | July 6, 2008 |
thank you, this has helped!
I had a subversion working copy so my problem was the .svn configuration directories. I modified the command to this:
find -type f -not \( -wholename ‘*svn*’ \) -exec dos2unix {} \;
for file in `find ./`; do dos2unix $file $file; done
HTH…
Maku
that doesn’t work in solaris 10…
use below command
for i in `find . -type f` ; do dos2unix $i $i; done
find $RELEASE_DIR -name “*.xml” -exec dos2unix {} \;