Changes

Jump to: navigation, search

OPS235 Lab 3 - CentOS7 - VMware

51 bytes added, 14:43, 6 June 2016
no edit summary
# Use a text editor (such as <b><code><span style="color:#3366CC;font-size:1.2em;">vi</span></code></b> or <b><code><span style="color:#3366CC;font-size:1.2em;">nano</span></code></b>) to create a Bash Shell script called: <b><code><span style="color:#3366CC;font-size:1.2em;">packageInfo.bash</span></code></b> in root's home directory.
# Enter the following text content into your text-editing session:
<code style="color:#3366CC;font-family:courier;font-size:.9em;margin-left:20px;font-weight:bold;">
<br>
&#35;!/bin/bash <br>
<ol><li value="4">Save your editing session, but remain in the text editor.</li><li>The code displayed below will require the user to include only one argument after the command (script) which will be the application name. The following code will also generate the report title and current date. Add the following code</li></ol>
<br>
<code style="color:#3366CC;font-family:courier;font-size:.9em;font-weight:bold;">
if [ $# -ne 1 ]<br>
<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;font-weight:bold;">
&#35; Clear screen and use Here Document to display select on report items to read into variable<br>
clear<br>
13,420
edits

Navigation menu