Changes

Jump to: navigation, search

OPS235 Lab 3 - CentOS7

1,098 bytes added, 07:31, 8 April 2015
no edit summary
</code>
<ol><li value="6">Save your editing session, but remain in the text editor.</li><li>The code displayed below uses a trick called the "Here Document" to redirect stdin from within the command (a quick way to display output on the screen). The read command will store the different information report items as words (separated by a space). The sed command used to convert the spaces to pipes (|) and stored into another variable. This allows the sed command to use extended regular expressions to print rpm elements that match those various patterns to be added to the report. Add the following code</li></ol>
<br>
<code style="color:#3366CC;font-family:courier;font-size:.9em;">
::clear
::cat &lt;&lt;+
:Available Package Information Items:
<br>
::Name
::Summary
::Version
::License
::Source
::URL
<br>
::+
::read -p "Enter word(s) shown above separated by spaces: " choice
::processedChoice=$(echo $choice | sed 's/ /|/g')
<br>
::rpm -qi $1 | sed -r -n "/($processedChoice)/ p" &gt;&gt; /root/package-info.txt
<br>
::cat &lt;&lt;+
<br>
::File "/root/package-info.txt" can been created
::+
 
</code>
<ol>
<li value="78">Save, set permissions, and then run that shell script to backup centos1. Confirm that this script did backup this image to root's home directory</li><li>Use the <b><code>wget</code></b> command to download, study, and run the following shell scripts on-line:<blockquote><b><code><span style=" pointer-events:none;cursor:default;color:#3366CC;font-size:1.2em;">https://scs.senecac.on.ca/~murray.saul/vm-start-text.bash<br>https://scs.senecac.on.ca/~murray.saul/vm-stop-text.bash</span></code></b><br><b><code><span style=" pointer-events:none;cursor:default;color:#3366CC;font-size:1.2em;">https://scs.senecac.on.ca/~murray.saul/vm-start.bash<br>https://scs.senecac.on.ca/~murray.saul/vm-stop.bash</span></code></b></blockquote></li><li>Try to understand what these Bash Shell scripts do.</li><li>#You have completed lab2. Proceed to Completing The Lab, and follow the instructions for "lab sign-off".</li></ol>
'''Answer all observations / questions in your lab log book.'''
13,420
edits

Navigation menu