I'm trying to setup a linter for my code and I only want to lint the coffeescript files that have changed in the current branch. So, I generate the list of files using git:git diff --name-only develop | grep coffee$That gives me a nice list of the files I'd like to process but I can't remember how to pipe this to the linting program to actually do the work. Basically I'd like something similar to find's -exec:find . -name \*.coffee -exec ./node_modules/.bin/coffeelint '{}' \;Thanks!
How can I pipe stdout to another program?
shell;pipe;git;stdout
xargs is the unix utility I was looking for. From the man page:The xargs utility reads space, tab, newline and end-of-file delimited strings from the standard input and executes utility with the strings as arguments.Any arguments specified on the command line are given to utility upon each invocation, followed by some number of the arguments read from the standard input of xargs.  The utility is repeatedly executed until standard input is exhausted.So, the solution to my original question is:git diff --diff-filter=M --name-only develop | grep coffee$ | xargs ./node_modules/.bin/coffeelint