mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-03-11 08:58:29 +00:00
Move pages under tldr, lint run.sh, update docs
This commit is contained in:
29
tldr/windows/for
Normal file
29
tldr/windows/for
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# for
|
||||
|
||||
> Conditionally execute a command several times.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/for>.
|
||||
|
||||
- Execute given commands for the specified set:
|
||||
|
||||
`for %{{variable}} in ({{item_a item_b item_c}}) do ({{echo Loop is executed}})`
|
||||
|
||||
- Iterate over a given range of numbers:
|
||||
|
||||
`for /l %{{variable}} in ({{from}}, {{step}}, {{to}}) do ({{echo Loop is executed}})`
|
||||
|
||||
- Iterate over a given list of files:
|
||||
|
||||
`for %{{variable}} in ({{path oile1.ext path oile2.ext ...}}) do ({{echo Loop is executed}})`
|
||||
|
||||
- Iterate over a given list of directories:
|
||||
|
||||
`for /d %{{variable}} in ({{path o\directory1.ext path o\directory2.ext ...}}) do ({{echo Loop is executed}})`
|
||||
|
||||
- Perform a given command in every directory:
|
||||
|
||||
`for /d %{{variable}} in (*) do (if exist %{{variable}} {{echo Loop is executed}})`
|
||||
Reference in New Issue
Block a user