just wondering if my code is sound for running a command remotely on server list
I have a list of IP's that I've put into a file called servers.txt. These boxes all have the same root password for testing this.
Then I was going to run something like: Code:
file = servers.txt |
No. That will just read:
Code:
for i in servers.txt Code:
for i in `cat servers.txt` |
makes sense...thanks.
|
It's recommended to use while+read instead of for loop for reading input from a file:
Code:
#!/bin/bash http://mywiki.wooledge.org/BashFAQ/001 |
All times are GMT -5. The time now is 11:20 AM. |