Stop Writing Bash for Loop

1 · Sy Tran Dung · Jan. 24, 2024, 8:39 a.m.
If you love CLI and run a lot of commands, write a lot of bash scripts, you probably know bash for loop. For example to count from 1 to 10, we can write for i in {1..10}; do echo $i; done . Or if we have an array of items, and want to iterate over it, we can write items=(1 2 3 4 5) for item in ${items[@]}; do echo $item; done Easy peasy....