[wplug] script question

Michael Semcheski lists at immuneit.com
Fri Jan 19 20:21:12 EST 2007


Zach wrote:
> I wish to use the program dos2unix on a large number of files. To run
>  it I normally do "dos2unix foo1 foo1" so it keeps the same filename.
>  Anyone know how to mak ethis into a shell script so I could do:
> "dos2unix.sh *.htm, *.txt" etc..

What I would do:

find . -iname '*.htm' -exec dos2unix {} {} \;

or

find /home/zach/txt -iname '*.htm' -exec dos2unix {} {} \;

Find each file in /home/zach/txt which has a name that matches the (case
insensitive) regular expression *.htm.  For each file found, run the
program 'dos2unix file1 file1'.  (The {} is replaced with the name of
the found file.  The ; ends the command.  You need to escape the semicolon.)

What else ya got?





More information about the wplug mailing list