I am trying to loop through a list of servers and rather than manually enter each one in a text file, I wanted to use an expression.
Example:
[user@server001 ~]$ for i in server{001..010} ; do echo $i ; done
server001
server002
server003
server004
server005
server006
server007
server008
server009
server010
That Produces the desired result. However when I put server{001..010} into a .txt file and try to do the same thing, it doesn't work:
[user@server001 ~]$ cat server_test2.txt
server{001..010}
[user@server001 ~]$ for i in `cat server_test2.txt` ; do echo $i ; done
server{001..010}
As you can see it doesn't actually handle the expression the way I'd like it to.
Any ideas how I can extrapolate from a txt file with multiple lines of servers using the expression method? {001..010}