BASH – FOR loop with variable based range If you need to execute the FOR loop the N number of times, and this value will be set by a variable, the script will look like this:
BASH – List based FOR loop For example, there is a file "/home/artem/IP" with IP addresses on which you want to execute a remote command, the FOR loop will look like this: