for loops are a programming command used to iterate through a set of commands a specified number of times, or until a condition is met

learn more… | top users | synonyms

-1
votes
2answers
139 views

Try the command multiple times [closed]

I need to execute a command and also check if it was successful. If there was an error, I should try again and the following code is working as expected. But what if I need to try the same command 3 ...
0
votes
1answer
926 views

Parse all text files in a folder using FOR /F command [closed]

There are numbers of txt file in a folder. Now I want to open all txt file and print the contents to a single txt file. Condition is, I want to skip first two lines of every txt file. I was trying ...
1
vote
1answer
147 views

for loop windows cmd

I'am using Windows cmd to calculate some variables. The command works fine: gut adapt_gf -InFile sla1.nc -OutFile sla_grid1.nc However, I have many sla values (sla1.nc,sla2, sla3, etc). Is there ...
1
vote
2answers
254 views

max_execution_time (PHP) <- when does it start to count?

I have few very-long-executing scripts, and my max_execution_time is 5 However, when I was taking some information from plus.google.com, it took about five minutes. It all worked well but it was just ...
1
vote
2answers
308 views

for loop multiple variables

I've two text files and I want to put each line from both files as output i.e. #!/bin/bash u=`cat newlist` for i in $u do echo "" echo ",'$i'" for b in $( cat password ) do echo ",'$b'" done done ...
1
vote
1answer
303 views

Preventing expansion of : in batch file for loop

Trying to build a cmdline tool for reviewing TFS changesets. Currently I have this: rem I know there's redundancy here, but don't care for now set /A curr=%1 set /A prev=%curr% set /A prev-=1 for ...
13
votes
3answers
59k views

For Loop counting from 1 to n in a windows bat script

I need to run a windows command n times within a bat script file. I know how to do this in various programming languages but cannot manage to get it right on the windows command line :-( I would ...
1
vote
2answers
548 views

How to do some actions for each file in a folder?

I have a folder with files having .foo extension. I need a batch file to execute some commands for each file in that folder having that extension. How should i do that? Seems I need a loop after ...
0
votes
2answers
2k views

batch for loop with bracket in the command

I have a batch file with the following code: for /f "tokens=*" %%a in ('dir /b /a-d') do ( echo Processing %%a >>%LOG% dtsrun /S(local) /NNotesLoad /A"FilePath:8="%NOTESDIR%\%%a" ...