能否更改传递给find中exec的参数呢? 例如,我需要将文件复制为不同的名称:*.txt -> *.new.txt 现在我需要执行两个命令:
find /root/test -name "*.txt" -exec cp {} {}.new \;
find /root/test -name "*.txt.new" -exec rename .txt.new .new.txt {} \;
是否可以解析 {} 来访问文件扩展名?类似于(我不确定):
-exec cp {} {$1}.new.txt \;