I want to run git stripspace on all my source code files, on each build (or precommit or just manually), to remove extraneous whitespace, and later maybe to format the code in a standard way,    So I want to do something like  git stripspace < project/code.m > project/code.mso I thought I should be able to use find -exec or xargs but by the looks of find does not like 'git stripspace' (maybe because of the space in between or the < or >) and I don't know how to pass the same file name, same argument, twice in a row with the proper redirections (< >) .  
xargs and < and > to the same files
shell;io redirection;xargs
You're clobbering the file before you read from it. You need to use a temporary file or a utility like sponge from moreutils.You can't use find -exec or xargs in this case. You would need to pass a shell a single argument containing both the commands and the file name. xargs and find expect the file name marker (which they replace with the file name) to be a standalone argument. You can use a loop instead.With a temporary file:find | while read file ; do    git stripspace < $file > tempfile    mv -f tempfile $filedoneWith sponge:find | while read file ; do    git stripspace < $file | sponge $filedone