13,420
edits
Changes
no edit summary
fi<br>
</code>
<ol><li value="5">We will now use an Associative Array along with the ssh command in order to get and store networking configuration from the '''centos1''', '''centos2''', and '''centos3''' VMs. Add the following content to your shell script editing session:</li></ol>
<code style="color:#3366CC;font-family:courier;font-size:.9em;margin-left:20px;font-weight:bold;">
<br>
done<br>
</code>
<ol><li value="6">Finally, we will use a loop to printout the results of the data (stored in the Associative Arrays) in a report file called: /root/network-info.txtThe command at the end is a trick to remove all temporary files that have the same extension as the current PID number, therefore, it is unique.<br><br><ol><li value="6">Add the following content to your shell script editing session:</li></ol>
<br>
<code style="color:#3366CC;font-family:courier;font-size:.9em;margin-left:20px;font-weight:bold;">
rm /tmp/*.$$
</code>
<ol><li value="7">Give this shell script execute permissions and run this shell script. What do you notice from the report that the shell script generated?<br><br></li><li>The the wget command to download, set permissions and run the following script to see the usefulness of arrays: '''URL'''</li></ol>