mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-08-03 21:15:32 +02:00
for: add page (#7442)
This commit is contained in:
parent
2f636d094e
commit
6920317eec
1 changed files with 24 additions and 0 deletions
24
pages/windows/for.md
Normal file
24
pages/windows/for.md
Normal file
|
@ -0,0 +1,24 @@
|
|||
# for
|
||||
|
||||
> Conditionally execute a command several times.
|
||||
> More information: <https://docs.microsoft.com/windows-server/administration/windows-commands/for>.
|
||||
|
||||
- Execute the specified commands for the specified set:
|
||||
|
||||
`for %{{variable}} in ({{item_a item_b item_c}}) do ({{echo Loop is executed}})`
|
||||
|
||||
- Iterate over range:
|
||||
|
||||
`for /l %{{variable}} in ({{from}}, {{step}}, {{to}}) do ({{echo Loop is executed}})`
|
||||
|
||||
- Iterate over files:
|
||||
|
||||
`for %{{variable}} in ({{file_a.ext file_b.ext file_c.ext}}) do ({{echo Loop is executed}})`
|
||||
|
||||
- Iterate over directories:
|
||||
|
||||
`for /d %{{variable}} in ({{directory_a/ directory_b/ directory_c/}}) do ({{echo Loop is executed}})`
|
||||
|
||||
- Perform a command in every directory:
|
||||
|
||||
`for /d %{{variable}} in (*) do (if exist %{{variable}} {{echo Loop is executed}})`
|
Loading…
Add table
Reference in a new issue