for i in $(seq 1 4); do echo $i; done
will output:
1 2 3 4
Here's a more practical example to run a command for every file returned by the ls command:
for FILE in $(ls *.zip); do unzip $FILE; done
Author: Lucas Vieites ✦ Published: ✦ Updated: ✦
