Open main menu

CDOT Wiki β

Changes

OPS235 Lab 1 - CentOS7

45 bytes removed, 15:42, 31 March 2015
no edit summary
# Enter the following text content into your text-editing session:
<span style="font-size:1.5em;"pre> #!/bin/bash # Forces script to run in the bash shell # Author: *** INSERT YOUR NAME *** # Date: *** CURRENT DATE *** # # Purpose: To present sysadmin to create an software inventory # report containing selected elements # # USAGE: ./report.bash if [ $USER != "root" ] # checks to see if user is root, and exits script if not then echo "You must be logged in as root to run the command." >&2 # >&2 is a "redirection trick" to convert output as stderr echo "Either login as root or issue command \"sudo ./report1.bash\"" >&2 exit 1 fi </spanpre>
<ol><li value="4">Save your editing session, assign your report.bash file read and execute permissions (at least for the owner) and run by typing: ./report.bash</li><li>Did it run? If not what do you think you need to do in order to run the Bash Shell Script?</li><li>Issue the command su and run the Bash shell again. Did it work?</li></ol>
13,420
edits