While loop is finished before doing all of jobs!
This is the part of my code to ssh some hosts, but the loop would be finished before reading all of IPs in the file named IPvar and then the script is finished!some times it works for 3 IP,some times for 5 ,...
Code:
while read IP |
Well I see you use set -xv but have it only working for one line of the code. Try switching it on before the loop and seeing what is actually happening
|
To simplify that further, use what grail suggests, but also just put an echo line in your loop. Example:
Code:
set -xv What's the nature of IPvar, is that just a list? If so and you intend to perform a loop on all entries of IPvar, then why not just a for loop? |
All times are GMT -5. The time now is 02:16 AM. |