We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
sh
#!/bin/sh for i in {1..5}; do ...
Here, $i expands to {1..5}. It does not expand to the sequence 1 2 3 4 5
$i
{1..5}
1 2 3 4 5
#!/bin/sh i=1 # while $i ≤ 5 ... while [ "${i}" -le 5 ]; do ... # something that will occur 5 times i=$((i + 1)) done
You can also use the seq command, e.g. seq 1 5, but seq is not a POSIX utility.
seq
seq 1 5
None
There was an error while loading. Please reload this page.