TIL - 2023-04-13 // Write a for loop in the Bash command line

Write a single line for loop using the Bash command line

A simple for loop in Bash follows the basic structure of:

for i in 1 2 3
do
  echo $i
done

To write this as a single line on the command line the lines need to separated by semicolons.

for i in 1 2 3; do echo $i; done