Reputation: 80
how to write the command??
I tried find . -name test.bash | xargs bash dd
, this threw an error bash: xx: No such file or directory
I also tried find . -name test.bash | xargs bash -c
, can't work too.
Upvotes: 1
Views: 642
Reputation: 8591
I created a test script, super simple, it just prints the arguments.
#!/bin/bash
echo "$@"
Then I find it in it's directory and call it with arguments:
find . -name test.bash -exec {} arg1 arg2 \;
It runs and outputs "arg1 arg2".
Upvotes: 4