Shellscript: for numeric

#!/bin/bash
for number in 1 2 3 4 5
do
echo $number
done
#!/bin/bash
for number in {1..10}; do
    echo "$number "
done
#!/bin/bash
for number in {0..100..10}; do
    echo "$number "
done
#!/bin/bash
for ((number=1;number < 100;number++)){
    if (( $number % 5 == 0 )); then
        echo "$number is divisible by 5 "
    fi
}
exit 0

Referências

https://www.lifewire.com/bash-for-loop-examples-2200575

Comentários