find -exec {} + 的尾随参数 [英] Trailing arguments with find -exec {} +
本文介绍了find -exec {} + 的尾随参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
I want to add a trailing argument to the appending version of the-exec
option of find
.
find . -exec echo {} asd +
# expecting the following output:
file1 file2 file3 [...] asd
Does not work as {}
must be the last word before +
. (Bonus question: Why was that trivial looking feature not implemented?)
What is the simplest expression to archive this, that can handle filenames with spaces and special characters? POSIX conformance would be a nice to have but it is sufficient if it works with Linux.
解决方案
find . -exec sh -c 'echo "$@" asd' _ {} +
这篇关于find -exec {} + 的尾随参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文