About 2,650,000 results
Open links in new tab
  1. 9 Examples of for Loops in Linux Bash Scripts

    Oct 30, 2023 · The versatile Bash for loop does much more than loop around a set number of times. We describe its many variants so you can use them successfully in your own Linux scripts.

  2. Looping Statements | Shell Script - GeeksforGeeks

    Nov 17, 2025 · Loops are a fundamental part of programming, and shell scripting is no exception. They allow you to automate repetitive tasks by running a block of code multiple times. You will use loops …

  3. unix - Shell script "for" loop syntax - Stack Overflow

    There is no good reason to use an external command such as seq to count and increment numbers in the for loop, hence it is recommend that you avoid using seq. This command is left for compatibility …

  4. Bash For Loop Examples - nixCraft

    Jan 31, 2025 · Explains how to use a Bash for loop control flow statement on Linux / UNIX / *BSD / macOS bash shell with various programming examples.

  5. Bash Loops - W3Schools

    This section covers the use of loops in Bash scripting, including for, while, and until loops. For loops allow you to iterate over a list of items or a range of numbers. They are useful for repeating tasks a …

  6. Bash For Loop: Syntax and Examples - Linuxize

    Dec 1, 2025 · This guide focuses on the for loop in Bash, including its syntax variations, nesting, flow-control statements like break and continue, and practical examples.

  7. Bash For Loop: A Comprehensive Guide to Iteration in Shell Scripting

    Dec 8, 2025 · This guide will take you from the basics of Bash `for` loops to advanced techniques, with practical examples, best practices, and troubleshooting tips. By the end, you’ll be equipped to write …

  8. Using for loops and while loops in a shell script - The Shell Scripting ...

    As a result, we have for and while loops in the Bourne shell. This is somewhat fewer features than other languages, but nobody claimed that shell programming has the power of C. echo "Looping ... number …

  9. 16 Examples of For Loop in Shell Script [Free Downloads]

    Mar 13, 2024 · In this article, you will get to learn all about the for loop in Shell Script with the help of practical examples. Similar to all the programming languages, the for loop in Shell Scripting also …

  10. Bash For Loop Examples Explained Simply for Beginners

    Aug 26, 2025 · If you are new to Bash scripting or Linux shell scripting, one of the most useful concepts you need to learn is the Bash for loop. A for loop allows you to run a command multiple times without …