Repeat part of script infinitely ?

 
Thread Tools Search this Thread
Special Forums Windows & DOS: Issues & Discussions Repeat part of script infinitely ?
# 1  
Old 03-09-2013
Repeat part of script infinitely ?

I currently have this script:

Code:
"%IMG%compare" -metric RMSE %SRC% %SUB% -subimage-search found.png 2>co.txt
set /p xycos= <co.txt
set str=%xycos%
echo.%str%
set str=%str:,=+%
ECHO %str% > co.TXT
set /p xycos= <co.txt
set str=%xycos%
echo."%str%"
set str=%str: =%
ECHO %str% > co.TXT
set /p xycos= <co.txt
set str=%xycos%
echo.%str%
set str=%str:@=      +%
ECHO %str% > co.TXT
set /p xycos= <co.txt
set str=%xycos%
echo.%str%
set str=%str:~-8%
ECHO %str% > co.TXT
set /p xcoyco= <co.txt
"%IMG%convert" ^
  %SRC% ^
  ( %REP% -geometry %xcoyco% ) ^
  -composite ^
  %SOURCE%
DEL found-0.png
DEL found-1.png

Is there any way I can repeat it infinitely till it terminates itself (will happen once it won't find any more matches) ?

I haven't found such method in DOS yet and pasting the script a dozen hundered time isn't what I'm after either.

Also:
lets assume I have a script that asks the user how many times it should repeat (for example 3 times), repeats said times and closes.
Possible with DOS ?
# 2  
Old 03-11-2013
The very old fashioned way: windows - Batch script loop - Stack Overflow
Code:
 
:loop
.
.
.
if ... GOTO xit
.
. 
.
GOTO loop
:xit

# 3  
Old 03-16-2013
Thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to make a loop to read the input from a file part by part?

Hi All, We've a VDI infrastructure in AWS (AWS workspaces) and we're planning to automate the process of provisioning workspaces. Instead of going to GUI console, and launching workspaces by selecting individual users is little time consuming. Thus, I want to create them in bunches from AWS CLI... (6 Replies)
Discussion started by: arun_adm
6 Replies

2. Shell Programming and Scripting

Shell script works fine as a standalone script but not as part of a bigger script

Hello all, I am facing a weird issue while executing a code below - #!/bin/bash cd /wload/baot/home/baotasa0/sandboxes_finance/ext_ukba_bde/pset sh UKBA_publish.sh UKBA 28082015 3 if then echo "Param file conversion for all the areas are completed, please check in your home directory"... (2 Replies)
Discussion started by: ektubbe
2 Replies

3. Shell Programming and Scripting

[Solved] Printing a part of the last line of the specific part of a file

Hi, I have 80 large files, from which I want to get a specific value to run a Bash script. Firstly, I want to get the part of a file which contains this: Name =A xxxxxx yyyyyy zzzzzz aaaaaa bbbbbb Value = 57 This is necessary because in a file there are written more lines which... (6 Replies)
Discussion started by: wenclu
6 Replies

4. Shell Programming and Scripting

perl script to find, write, repeat...

I am a novice writing perl scripts so I'd appreciate any help you guys can offer. I have a list of 100 words in a file (words.txt) and I need to find them in a second file (data.txt). Whenever one of these words is found I need to write that line to a third file (out.txt) and then continue... (1 Reply)
Discussion started by: tgamble
1 Replies

5. Shell Programming and Scripting

Part of string with script

Hi All, I have few files named. abcd.docx abcde.doc abcdef.temp I wish if I could extract the string upto .(dot),and not the extension. Thanks a lot. Kind regards, Indranil. (4 Replies)
Discussion started by: Indra2011
4 Replies

6. BSD

gdm restart infinitely

Salamo Alikom when i start gdm to log in ,i found it restart infinitely . my log files : (1 Reply)
Discussion started by: SIFE
1 Replies

7. Shell Programming and Scripting

Repeat function in shell script

Hi all, I want to use the wget command to download a file from a webpage and if just in case the file is empty the script should repeat the wget command. something like this wget -q -O - http://www.someurl.something > /tmp/file if ] ; then echo "$FILE has data." (Continue rest of the... (3 Replies)
Discussion started by: stinkefisch
3 Replies

8. UNIX for Dummies Questions & Answers

Else part is not working in my script

if ; then echo "Below are the Error Displayed log for the Run Number " >> /home/sa721493/error details grep ERROR Device.log device gen.log Driver.log >>error details else echo "No ERROR Found for the Run Number: $1" fi The else part is never getting executed. (3 Replies)
Discussion started by: vls1210
3 Replies

9. Shell Programming and Scripting

SUPER simple bash script to repeat a command...

I need to repeat this command on a configurable interval: igal -a -r -U -w 6 I tried this: #!/bin/bash igal -a -r -U -w 6 sleep 30 Just a guess that it MIGHT work. Can anyone point me in the right direction? -R (6 Replies)
Discussion started by: robfindlay
6 Replies
Login or Register to Ask a Question