Changes

Jump to: navigation, search

OPS235 Lab 2 - CentOS7 - VMware

17 bytes added, 07:57, 6 June 2016
no edit summary
<ol><li value="8">Save and run the bash shell script. View the contents of the file called '''report.txt''' that was generated (I hope you are using the up arrow key to issue previously issued commands in order to save time!). Notice how the redirection symbol &gt; is used at the beginning of the report, and then the other redirection symbol &gt;&gt; is used to help "grow" the report with the other content.</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>
<br>
<code style="color:#3366CC;font-family:courier;font-size:.9em;font-weight:bold;">
echo >> /root/report.txt<br>
echo "Hostname: $(hostname)" >> /root/report.txt<br>
13,420
edits

Navigation menu