13,420
edits
Changes
no edit summary
<br>
<ol><li value="5">Add the following content to your shell script editing session:</li></ol>
do<br>
read -p "Enter regular username for \"$x\" server: " userName[$x]<br>
ssh ${userName[$x]}@$x "cat /etc/network/interfaces" > /tmp/network-$x.txt$$<br>
<br>
index=0 # load each line into an array for VM<br>
$x[$index]="$line"<br>
index=$(($index+1))<br>
done < /tmp/network-$x.txt$$<br>
done<br>
</code>
<br>
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.txt
The 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>