The fork-intensive=slow
Code:
find . -name '*_test.rb' -exec bash -c 'echo mv "$0" "${0/test.rb/spec.rb}"' {} \;
can be made faster if you terminate the -exec with a +
The execed command must be able to process multiple arguments; a bash script must cycle through the args by means of a loop; a for loop takes the arg list by default.
The following multi-liner demonstrates it
Code:
find . -name '*_test.rb' -exec /bin/sh -c '
for arg
do
echo mv "$arg" "${arg/test.rb/spec.rb}"
done
' mv_script {} +
Note that "mv_script" is passed to $0; so the file names are passed to the default arg list "${@}" i.e. "$1" "$2" ...