Skywalker1957
Technical User
Have a quick question. I need to configure a file with arguments for my robotic libraries to run an inventory check command. How do I loop through the list and use my multiple arguments from each line.
Example config file robots.conf
# type num host
TLD 0 nbu001
TLD 1 nbu002
TLD 2 nbu003
I'm guessing this would need some kind of for loop with awk that could substitute the three fields above as arguments into my command line right?
Unfortuantely I don't know how to assign variables within awk, but it seems to me this ought to be easy enough to do on one line. Oreilly's hasn't been too helpful to me yet.
This is the command I'm trying to use to insert the arguments above into.
Example of tape_check.sh
#Run mismatch/checker command
vmcheckxxx -rt $type -rn $num -rh $host |mailx -s "Robot $num on $host tape check - `date`" email_address
Any help would be greatly appreciated! Thanks!
Example config file robots.conf
# type num host
TLD 0 nbu001
TLD 1 nbu002
TLD 2 nbu003
I'm guessing this would need some kind of for loop with awk that could substitute the three fields above as arguments into my command line right?
Unfortuantely I don't know how to assign variables within awk, but it seems to me this ought to be easy enough to do on one line. Oreilly's hasn't been too helpful to me yet.
This is the command I'm trying to use to insert the arguments above into.
Example of tape_check.sh
#Run mismatch/checker command
vmcheckxxx -rt $type -rn $num -rh $host |mailx -s "Robot $num on $host tape check - `date`" email_address
Any help would be greatly appreciated! Thanks!