Linux 列出 svn 存储库中的目录条目?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3745744/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
list directory entries in the svn repository?
提问by Osama Ahmad
How can I write a bash script to list directory entries in the svn repository? I want to write bash file because i have a large number of repositories.
如何编写 bash 脚本来列出 svn 存储库中的目录条目?我想编写 bash 文件,因为我有大量的存储库。
采纳答案by Mark O'Connor
If you are the subversion administrator, the following command will return the directories located in your repository.
如果您是 subversion 管理员,以下命令将返回位于您的存储库中的目录。
svnlook tree $REPO_DIR --full-paths | egrep "/$"
The trick is the grep command that is looking for a trailing "/" character in the name
诀窍是 grep 命令在名称中查找尾随的“/”字符
Same trick works for the svn command as well
同样的技巧也适用于 svn 命令
svn list $REPO_URL -R | egrep "/$"
Extra notes
附加说明
To repeatedly run this command you can put it into a shell for loop
要重复运行此命令,您可以将其放入 shell for 循环
for url in $URL1 $URL2 $URL2
do
svn list $url -R | egrep "/$"
done