how to run an already made script run against a list of ip addresses solaris 8 question

dunno if this would be clearer ...

#
# this is in sh
#

for ip in `cat ip_list`
do
    check_GE-VLANStats-P3 $ip
    check_GE-VLANStats-P3 $ip
done

to avoid the UUOC condition referred to by vbe -- use a shell that can handle redirects better (i.e., bash or ksh) than sh ...

#
# this works in bash and ksh
#

for ip in `< ip_list`
do
    check_GE-VLANStats-P3 $ip
    check_GE-VLANStats-P3 $ip
done

1 Like

when we say ip I understand we reffer to $ip variable, but has ip got anything to do with internet protocol sorry for being thick

any good links to most common variables etc?

hope it's clearER.

while read llcooljatt 
do    
    echo $llcooljatt 
done < ip_list
1 Like

you can name your variables very much any way you want to (see man sh, man ksh, man bash, etc.) ... however ... it is always good to be able to easily figure out what the variables stand for just by looking at the code ... see below ...

#
# vague variable
#

for a in `< mylist`
do
    echo $a
done

===========
#
# more obvious variable
#

for file in `< mylist`
do
    echo $file
done

1 Like

Ok I understand the variable can be named anything but is there any significance in ip_list to the variable? If not is llcooljatt the name of where we echo's the results too?

with some limitations, you can have filenames named the same way as your variables if that suits your fancy ... the main thing is that you understand what is in the file just like you would want to understand what the variable stands for ...

1 Like

Ok so simply put

Variable = where our results echo'd too?
Filename = list of ip addresses