13,420
edits
Changes
no edit summary
<ol><li>Save and run the bash shell script. View the contents of the file called "report.txt" that was generated.</li><li>The only remaining content of the report would be the system information. We can use a shell scripting trick called "command substitution" $( .. ) in order place results from an command to be used by another command (like echo). Re-edit the shell script and add the following code at the bottom of the shell script file:</li></ol>
<pre style="font-family:courier;font-weight:bold;padding-left:4px;margin-left:15px;">
echo >> /root/report.txt
echo "Hostname: $(hostname)" >> /root/report.txt
echo >> /root/report.txt
echo >> /root/report.txt
echo "Kernel Version: $(uname -rv)" >> /root/report.txt
echo >> /root/report.txt
</pre>