Problem in loop execution

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Problem in loop execution
# 1  
Old 08-12-2011
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,)

And I want this in loop

[shell script]value[/shell script]
unset Reponame
cd ${RepoList}
List=`ls|cut -d " " -f6`
for i in ${List};do echo "${i}";done>/home/e030809/Repo.txt
cat /home/e030809/Repo.txt|while read line; do count=`echo $count + 1 | bc`; echo "$count)$line"; done|tee /home/e030809/Repo1.txt
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;
             if [ -z $usrInput ];then
                      return 0;
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
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)
echo -e "Repository "${Reponame}" has below modules.Please select appropriate number corresponding to module:"
cat /home/e030809/Repo3.txt|while read line; do count=`echo $count + 1 | bc`; echo "$count)$Reponame/$line"; done

Moderator's Comments:
Mod Comment Please use [CODE] tags when posting listings, instead of excessive color and font formatting. Also, it's probably a bad idea to post real host names in public

Last edited by anuragpgtgerman; 08-12-2011 at 12:04 PM.. Reason: I was puttng it in tags
# 2  
Old 08-16-2011
Anyone can help me to do the below task.Your efforts will be highly appricated.

# 3  
Old 08-16-2011

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.

# 4  
Old 08-17-2011
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


1ROHIT-------------|1) a

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


Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Execution problem

How to search a pattern from multiple files... i used the command suppose the pattern name is xxx grep xxx (file1-o- file2-o- file3) Thanks in advance (4 Replies)
Discussion started by: ksakil
4 Replies

2. Shell Programming and Scripting

Execution problem

Hi, I have been trying to run a simple script CONFIG_FILE="/jay/check" . . . for i in `cat $CONFIG_FILE` do loc=`echo $i | cut -d "|" -f2` var=$(find $loc -mtime -1|wc -l) if then echo $loc has files older than 1 day fi done . . . (2 Replies)
Discussion started by: jayii
2 Replies

3. Shell Programming and Scripting

Execution problem

hi all, when i tried executing the script by giving following command $ sh <parameter> it shows the following output: <none> status code=0 Previously it was working fine.But now its showing this output. (1 Reply)
Discussion started by: sanjay mn
1 Replies

4. UNIX for Dummies Questions & Answers

execution problem

HI I am trying to check the status of port using command /code: netstat -an | grep port /Output: *.2009 *.* 0 0 65535 0 LISTEN what i am trying to do is i want to grep only status Wether the port is established/listen if so show ok else... (1 Reply)
Discussion started by: esumiba
1 Replies

5. UNIX for Dummies Questions & Answers

execution problem

Hi I am automating my few commands out of which one command is tail -f running.logs when i run this command it does not automatically exit and show prompt (#) what would i do so that it will exit out automatically after few seconds and move to the next command without using ... (4 Replies)
Discussion started by: esumiba
4 Replies

6. UNIX for Dummies Questions & Answers

execution problem

Hi i have a file in which there are three fields code: 919804199233 404911130003916 357266044991350F and now i want to add two more fields i.e. code: 919804199233 404911130003916 357266044991350F ms 123 how can i do it using command line and if have a file of 100... (8 Replies)
Discussion started by: esumiba
8 Replies

7. Shell Programming and Scripting

For loop like execution in shell

Hi, In the script that i work now, I wrote the script such a way that the values retrieved using a tcl script is passed into a shell script to specify the path where the specific file needs to be sourced exists. For eg: I got a path from the tcl script given below, ... (6 Replies)
Discussion started by: shivashankar_S
6 Replies

8. Shell Programming and Scripting

Execution of SQLs thru loop

Hi, I have a file in which I have a number of insert statements (number is not fixed, it may have 10 statements or may be 1000....not fixed). I want to execute these statements using a loop (1 statement per iteration). For ex: Input file has following statements: Insert statement #... (6 Replies)
Discussion started by: ustechie
6 Replies

9. UNIX for Advanced & Expert Users

tar command loop during execution

I've some problem concerning tar command. Sometime tar command submitted to create a tar file, in execution loop over the same group of files. Can anyone help me? Tanks (15 Replies)
Discussion started by: Jocker
15 Replies

10. Programming

how to stop execution in for loop

Hi all, I am working on a c source code nearly 2000 line . it contains one big for( i=0; i< 200 ; i++ ) loop of around 600 lines could any tell me how to break the execution of prog when the value of i is 50 in for loop so that i can check inside the loop. Thanks.. (1 Reply)
Discussion started by: useless79
1 Replies
Login or Register to Ask a Question