As part of post-commit hook, I try to copy all the files that changed into a local folder - using this script (attached only the relevant part of the script):
svnlook changed ${REPOS} -r ${REV} | sed "s/^....//" | xargs -I {} svnlook cat ${REPOS} {} -r ${REV} > /tmp/commit2/{}
which won't replace the second {} with the xargs argument but use it as is (creating a file name '{}').
Is it possible to replace the argument after the output redirect?
Thanks, Roi
Not like that, no. The shell does the redirections, not xargs. xargs isn't even "aware" that a redirection is happening.
You could use something like the following:
svnlook changed ${REPOS} -r ${REV} |
sed "s/^....//" |
while read -r line ; do
svnlook cat ${REPOS} "$line" -r ${REV} > /tmp/commit2/"$line"
done
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With