Open main menu

CDOT Wiki β

Changes

OPS235 Lab 6 - CentOS7 - SSD

350 bytes added, 16:24, 14 June 2016
no edit summary
<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>
<br><code style="color:#3366CC;font-family:courier;font-size:.9em;margin-left:20px;font-weight:bold;"><br>for x<br>do<br>&nbsp;echo "Network Information for: \"$x\":" > /root/network-info.txt<br>&nbsp;printf '%s\n' "${$x[@]}" | tail -n +2 > /root/network-info.txt<br>&nbsp;echo > /root/network-info.txtdone<br><br>rm /tmp/*.$$ </code><br>
13,420
edits