13,420
edits
Changes
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;">
#!/bin/bash # Forces script to run in the bash shell<br>
<br>
# Date: *** CURRENT DATE ***<br>
#<br>
# Purpose: To present sysadmin to create an software inventory<br># Creates system info report containing selected elements<br>
#<br>
# USAGE: ./report.bash<br>
if [ $USER != "root" ] # only runs if logged in as root<br>
then<br>
echo "You must be logged in as root to run the command." >&2<br> echo "Either login as root or issue command \"sudo ./report1.bash\"" >&2<br>
exit 1<br>
fi<br>