Can someone explain why when attempting to run an ex command script on a number of files, this works:
for x in `ls *`;do ex $x <excmds;done;
but this doesn't:
ls *|xargs 开发者_如何学Go-i ex {} <excmds
The first will execute ex and run commands in "excmds" for each file The second, I'm not sure what it does, but it doesn't change any files. I'm guessing the re-direct is a problem, and doesn't act on each execution of xargs? Is there some way to do it with xargs? (yet another question I've raised on xargs - maybe I should stop using it :( )
Use GNU Parallel:
ls * | parallel ex {} \<excmds
Watch the intro video to learn more: http://www.youtube.com/watch?v=OpaiGYxkSuQ
10 seconds installation:
wget pi.dk/3 -qO - | sh -x
精彩评论