For Loop
The $()
is used to run a command here it will read all the names from the file names.txt and while EOF is not reached it will loop through all the names.
The alternate to {num1..num2} is making use of the seq command
$command
will print the name of the command. While just $command
will print execute the command
*
is used to access all the files and directory in the current path
The C syntax can also be used here as well
While Loop
The value colon ”:” always evaluates to true and can be used to create an infinite loop
Until Loop
The loop is executed for as long as the condition is false
Select Loop
Will automatically generate a menu from the list that is passed. It is generally used with the case statement to create a menu driven program
When making an one liner make sure to separate each line/ commands by using ;