【发布时间】:2014-05-13 08:59:44
【问题描述】:
是否可以更改在 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 \;
【问题讨论】: