wal.wwutturi.com
Here are some examples of for loops in KSH (Korn Shell):
Basic for loop
``` sh
# Iterate from 1 to 10
for i in {1..10}; do
echo $i
done
```
For loop with step size
``` sh
# Iterate from 1 to 10 with a step size of 2
for i in {1..10..2}; do
echo $i
done
```
For loop over a range of numbers
``` sh
# Iterate from 1 to 10
for ((i=1; i<=10; i++)); do
echo $i
done
```
For loop over an array
``` sh
# Declare an array
my_array=(apple orange banana)
Iterate through the array valuesfor value in "${my_array[@]}"; do
echo "$value"
done
<h2>For loop over the output of a command</h2>
``` sh
# Iterate over the output of the ls command
for file in $(ls); do
echo "$file"
done
For more information on using for loops in KSH, you can consult the KSH manual or online documentation.