13,420
edits
Changes
no edit summary
# 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># Author: *** INSERT YOUR NAME ***<br># Date: *** CURRENT DATE ***<br>#<br># Purpose: Creates system info report<br>#<br># USAGE: ./report.bash<br><br><br>if [ $USER != "root" ] # only runs if logged in as root<br>then<br> echo "You must be logged in as root." >&2<br> exit 1<br>fi<br></code>
<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: <b><code><span style="color:#3366CC;font-size:1.2em;">./report.bash</span></code></b></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 <b><code><span style="color:#3366CC;font-size:1.2em;">su</span></code></b> and run the Bash shell again. Did it work?</li><li>Reopen your text-editing session for report.bash and add the following lines of code to the bottom of the shell script file:</ol>