Tuesday, January 30, 2007

Do on every file (win)


To run a command on every file:

for %i in (*.xml) do myCommandHere %i

or

for /R directoryHere %i in (*.xml) do myCommandHere %i

(use %% instead of % in batch files)


Also to recursively grep in windows,

findstr /S "findMe" directoryHere

(for some reason the cygwin grep doesn't seem to have the -R setting)

No comments: