Loop

  • Thread starter Thread starter Franck Diastein
  • Start date Start date
F

Franck Diastein

Hi, I woild like to know if it's possible to do this with Windows:

for repodir in `ls /svn`
do
svnadmin dump /svn/$repodir
done


I want to loop through dirs in a dir and use the dirs names in a command...

TIA
 
I don't know what a "ls /svn" is, it looks almost like a unix dir command but the switch char is wrong.

Type
for /?

FOR /d %A IN (C:\*.*) DO svnadmin dump /svn/%A

Use %%A in a batch file rather than %A
 
Franck said:
Hi, I woild like to know if it's possible to do this with Windows:

for repodir in `ls /svn`
do
svnadmin dump /svn/$repodir
done


I want to loop through dirs in a dir and use the dirs names in a command...

TIA

Hi Frank,

not exactly. Variable names are limited to one place, and the ls is
dir in DOs/windows :-)

in a batch file:
@echo off
for /F "Delims=" %%A in ('dir /B /AD /svn') do svnadmin dump /svn/%%A

from the cmd line use single percent signs:
for /f "Delims=" %A in ('dir /B /AD /svn') do svnadmin dump /svn/%A

if there are more levels of folders include the /S switch in the dir.

HTH
 
Excellent, thank you very much !!!

Matthias said:
Hi Frank,

not exactly. Variable names are limited to one place, and the ls is
dir in DOs/windows :-)

in a batch file:
@echo off
for /F "Delims=" %%A in ('dir /B /AD /svn') do svnadmin dump /svn/%%A

from the cmd line use single percent signs:
for /f "Delims=" %A in ('dir /B /AD /svn') do svnadmin dump /svn/%A

if there are more levels of folders include the /S switch in the dir.

HTH
 
Back
Top