Using 'find' I'm pla开发者_如何学Cnning to pass all files with a specific ending as an argument to a jar-file.
find $directory -type f -name "*.in"
Somehow this is supposed to happen:
java -jar MyJar-jar input.in
How can this be performed?
Thanks in Advance
find "$directory" -type f -name '*.in' -exec java -jar MyJar.jar {} \;
Replace \;
with +
if the application can take more than one file at a time as arguments.
xargs -0 -a<(find $directory -type f -name '*.in' -print0) java -jar MyJar.jar
java -jar MyJar.jar `find $directory -type f -name "*.in"`
should do the trick.
精彩评论