Open main menu

CDOT Wiki β

Changes

OPS235 Lab 1 - CentOS7

165 bytes removed, 14:09, 1 April 2015
no edit summary
# Open a Shell terminal and 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;">report.bash</span></code></b> in your current directory.
# Enter the following text content into your text-editing session:
<code style="color:#3366CC;font-family:courier;font-size:.9em;margin-left:20px;">
&#35;!/bin/bash # Forces script to run in the bash shell<br>
<br>
&#35; Date: *** CURRENT DATE ***<br>
&#35;<br>
&#35; Purpose: To present sysadmin to create an software inventory<br>&#35; Creates system info report containing selected elements<br>
&#35;<br>
&#35; USAGE: ./report.bash<br>
if [ $USER != "root" ] # only runs if logged in as root<br>
then<br>
&nbsp;echo "You must be logged in as root to run the command." >&2<br>&nbsp;echo "Either login as root or issue command \"sudo ./report1.bash\"" >&2<br>
&nbsp;exit 1<br>
fi<br>
13,420
edits