logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

For Loop - Execute Commands Repeatedly | Online Free DevTools by Hexmos

Execute shell commands repeatedly with For Loop. Automate tasks, iterate through files/directories, and streamline workflows. Free online tool, no registration required.

for

Perform a command several times. More information: https://www.gnu.org/software/bash/manual/bash.html#Looping-Constructs.

  • Iterate through command line arguments:

for {{variable}}; do {{echo $variable}}; done

  • Execute the given commands for each of the specified items:

for {{variable}} in {{item1 item2 ...}}; do {{echo "Loop is executed"}}; done

  • Iterate over a given range of numbers:

for {{variable}} in {{{from..to..step}}}; do {{echo "Loop is executed"}}; done

  • Iterate over a given list of files:

for {{variable}} in {{path/to/file1 path/to/file2 ...}}; do {{echo "Loop is executed"}}; done

  • Iterate over a given list of directories:

for {{variable}} in {{path/to/directory1/ path/to/directory2/ ...}}; do {{echo "Loop is executed"}}; done

  • Perform a given command in every directory:

for {{variable}} in */; do (cd "${{variable}}" || continue; {{echo "Loop is executed"}}) done

See Also