我有一个包含许多子目录的目录,我想在每个子目录上执行命令。
我想做的就是运行“ svn up”
这是我到目前为止尝试过的
find . -type d -maxdepth 1 -exec svn "up '{}'" \;
和
for dir in * do cd $dir; svn up; cd ..;
到目前为止,它们都不起作用(我已经尝试过很多没有运气的事情)
您只需要在glob后面加上一个斜杠即可:
for d in */; do # only match directories
( cd "$d" && svn up ) # Use a subshell to avoid having to cd back to the root each time.
done
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句