I have the following script running. As you can see it´s purpose is to get the a, b and c parameters from file.txt and input them into the command:

########################################

cat /file.txt | while read a b c; do

/usr/bin/rrdtool update "$a" --template "$b" $(date "+%s"):$($c)

########################################

But now I need to get the 3 parameters from different files. For instance, parameter A from fileA.txt, parameter B from fileB.txt and parameter C from fileC.txt...now since this is a cycle, I need them to respect their order from the file:

the parameter A from the 1st line from fileA.txt will correspond with parameter B from the 1st line from fileB.txt and the parameter C from the 1st line from fileC.txt.....

the parameter A from the 2nd line from fileA.txt will correspond with parameter B from the 2nd line from fileB.txt and the parameter C from the 2nd line from fileC.txt.....

That's interesting! You might want to take the contents of each file and insert them into an array. You could also use something like awk to get the parameter from the proper line (record, in awk) of each file. Could you go into a little more detail for your example?

Who is online

Users browsing this forum: No registered users and 9 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum