比方说,有目录和文件这样的:为什么没有这个壳工作
./app/cores/a/conf/props.conf.indexer
./app/cores/a/conf/props.conf.searcher
./app/cores/b/conf/props.conf.indexer
./app/cores/b/conf/props.conf.searcher
./app/cores/c/conf/props.conf.indexer
./app/cores/c/conf/props.conf.searcher
在我将应用程序目录部署到索引节点后,我想将app/cores/{core}/conf/props.conf.indexer
更改为app/cores/{core}/conf/props.conf
。
这里是我做过什么:
find ./app/cores/*/conf -name "props.conf.indexer" -exec echo $(cd $(dirname {}) && mv props.conf.indexer props.conf && ls -d props.conf) \;
,但是,它已经返回(props.conf.indexer
存在):
mv: rename props.conf.indexer to props.conf: No such file or directory
我的问题是,它是否是不可能使用{}
占位符$()
表达或不。
的'$()'部分得到由壳*之前*'find'执行。 – Biffen 2014-11-03 10:44:19
谢谢,这就是我想知道的 – 2014-11-03 13:38:02