💾 Archived View for freeshell.de › tldr › for.gmi captured on 2023-12-28 at 16:16:33. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2022-04-28)
-=-=-=-=-=-=-
Perform a command several times.
for {variable} in {item1 item2 ...}; do {echo "Loop is executed"}; done
for {variable} in {{from}..{to}..{step}}; do {echo "Loop is executed"}; done
for {variable} in {path/to/file1 path/to/file2 ...}; do {echo "Loop is executed"}; done
for {variable} in {path/to/directory1/ path/to/directory2/ ...}; do {echo "Loop is executed"}; done
for {variable} in */; do (cd "${variable}" || continue; {echo "Loop is executed"}) done
Copyright © 2014—present the tldr-pages team and contributors.
This work is licensed under the Creative Commons Attribution 4.0 International License (CC-BY).