Problem in loop execution

Below is my code. I want a loop in this way that if folder has tag sub-folder then it will show the list of tags otherwise it will show the subfolders of that folder and then again user will select sub-folder and if tags found then show the tag list otherwise show all subfolders till he finds the tag subfolder. Code should be append at the highlighted area

1.Rohit(user select any repo if select 1 then it will check if there is tags folder then it will run svn ls <url>/svn/tags or other wise show all modules(svn ls <url>/svn/module-name) inside this in listing(1,2,3,)
2.Singh
3.ajay

And I want this in loop

[shell script]value[/shell script]

unset Reponame
 
repolist()
{
RepoList=/mnt/scm/subversion/
cd ${RepoList}
List=`ls|cut -d " " -f6`
for i in ${List};do echo "${i}";done>/home/e030809/Repo.txt
count=0
cat /home/e030809/Repo.txt|while read line; do count=`echo $count + 1 | bc`; echo "$count)$line"; done|tee /home/e030809/Repo1.txt
}
 
sub_repolist()
{
echo -en "Enter the number corresponding to the repository to check list of labels or type q to quit(1,2...):"
read usrInput
if [[ "${usrInput}" == "Q" || "${usrInput}" == "q" ]]; then
            return 0;
          else
             if [ -z $usrInput ];then
                      return 0;
                  fi
fi
cat /home/e030809/Repo1.txt|grep -w "$usrInput"|cut -d ")" -f2|head -1|tee /home/e030809/Repo2.txt
Reponame=`cat /home/e030809/Repo2.txt|sed 's/[ \t]*$//' #`
#echo $Reponame
}
 
sub_repolist1()
{
svn ls http://repo_host/svn/${Reponame}/|cut -d "/" -f1 >/home/e030809/Repo3.txt  (This command show the list of subfolders)
find=`cat /home/e030809/Repo3.txt|grep -w "tags"|sed 's/[ \t]*$//' #`
if [[ "$find" == "tags" ]];then
svn ls http://repo_host/svn/${Reponame}/${find}  (This command will show the list of tags because find variable has value tags)
else
echo -e "Repository "${Reponame}" has below modules.Please select appropriate number corresponding to module:"
count=0
cat /home/e030809/Repo3.txt|while read line; do count=`echo $count + 1 | bc`; echo "$count)$Reponame/$line"; done
fi
}
repolist:
sub_repolist
sub_repolist1
 

Anyone can help me to do the below task.Your efforts will be highly appricated.

Thanks

Hi,

If you do not have any answer, think if you have not explained your problem correctly and in a way that others can understand.

In my case:
1.- I know nothing about subversion and don't understand what neither tag nor repo mean in that context.
2.- Does that shell script work? Any problem? What and where?
3.- Give an appropiate input (structure of folders, or something more useful) and what are you trying to achieve.

Regards,
Birei

Here I am using script on linux platform but the problem I am getting that I am not having exact path of repo u can say that I am not able to fetch the list of repositories

---------- Post updated at 06:42 AM ---------- Previous update was at 06:31 AM ----------

My problem here is

I have list of all main repo. But doesn�t have the path of sub. Repo. In svn only the command that use for this svn ls <url>/svn/reponame which can lsit eh name of sub-repo but I don�t have the idea upto which maxdepth these sub-repo.

1) I want to know the exact path of sub-repo
2) Want to show the list of tags and it is possible if we have exact and full path od sub-repo

Command that
Show the list of sub-repo inside main repo
Svn ls <url>/sv/repo

Command to show the tags
Svn ls <url>/sv/repo/tags

Example

1ROHIT-------------|1) a
|2)b

2 SINGH-------------|1) c
|2)d-------------------------1)e(has tag.branch and trunk folder) if I have full path of e(sub-repo) then I can use the command(Svn ls <url>/sv/repo/tags
) to check the list of tags

Svn ls <url>/svn/SINGH/d/e/tags will show the list of tags

My problem is I don�t know at which maxdepth this folder resides inside the main repo

3 KUMAR
4 NICE

Thanks