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.
- 3When will people stop writing "HELP ME" :/ @Mohammad: Clarify your question. What exactly is it you want to do?halfdan– halfdan2010-09-19 12:56:56 +00:00Commented Sep 19, 2010 at 12:56
- 1i write help me because i start to learn linux after 2 days ... and i have big work in it and in the following comment clear explain of my problemOsama Ahmad– Osama Ahmad2010-09-19 13:02:35 +00:00Commented Sep 19, 2010 at 13:02
- ok ... see the following example.... i do the following :- execute the this command to find the repository :- "sudo find / -type f -name fs-type -print " the following result appear :- "/var/lib/svn/repos/b1me/products/payone/impl/VJ/resources /var/lib/svn/repos/b1me/products/payone/impl/JKB/code/iris" and more maybe 500 repository now i want to show content of each repository for Followed in the next comment >>Osama Ahmad– Osama Ahmad2010-09-19 13:03:03 +00:00Commented Sep 19, 2010 at 13:03
- now i want to find the content of each repository for example :-"/var/lib/svn/repos/b1me/products/payone/generic/code/core" so i execute this command :- "svn list svn+ssh://svn.sts.com.jo/var/lib/svn/repos/b1me/products/payone/generic/code/core" but i have maybe 500 repository it is very complex to execute it for each one ...Taking into account each one require password –Osama Ahmad– Osama Ahmad2010-09-19 13:03:35 +00:00Commented Sep 19, 2010 at 13:03
- 1please i want to ask you .... no body answer this question WHY ? ... i ask more than "20" person and the same answer "i don't know" ... please i need the answer as soon as possible :(Osama Ahmad– Osama Ahmad2010-09-19 13:14:19 +00:00Commented Sep 19, 2010 at 13:14
| Show 1 more comment
1 Answer
If you are the subversion administrator, the following command will return the directories located in your repository.
svnlook tree $REPO_DIR --full-paths | egrep "/$" The trick is the grep command that is looking for a trailing "/" character in the name
Same trick works for the svn command as well
svn list $REPO_URL -R | egrep "/$" Extra notes
To repeatedly run this command you can put it into a shell for loop
for url in $URL1 $URL2 $URL2 do svn list $url -R | egrep "/$" done 12 Comments
Osama Ahmad
i try it now but the follwing result appear:- svnlook: invalid option: --full-paths Type 'svnlook help' for usage.
Mark O'Connor
I'm using subversion 1.6.6. Doco: svnbook.red-bean.com/en/1.5/svn.ref.svnlook.c.tree.html
Osama Ahmad
when i execute svn list $REPO_URL -R | egrep "/$" the following result svn: '.' is not a working copy
Mark O'Connor
Yes.... And I get the same result when running the following command: "svn list $I_SHOULD_REPLACE_THIS_WITH_MY_OWN_URL_LOCATION -R". Please use a valid subversion URL when running the command
Osama Ahmad
iam sorry i don't have expert in this field ... and i under big press... you mean like this "svn list $/var/lib/svn/repos -R | egrep "/$" " if you mean this the following result appearsvn: '$/var/lib/svn' is not a working copy
|