13,420
edits
Changes
→INVESTIGATION 2: USING VARIABLES IN SHELL SCRIPTS
# Issue the following linux command to change to the Bourne Shell (a different shell than the default Bash):<br><span style="color:blue;font-weight:bold;font-family:courier;">sh</span>
# Issue the following linux command to confirm you are in the Bourne Shell:<br><span style="color:blue;font-weight:bold;font-family:courier;">echo $SHELL</span><br><br>You should see the output of the command that you are located in the Bourne Shell.<br><br>
# Run your '''hello.bash''' shell script.<br><br>What shell does the shell script indicate is running?<br><br>This is because there is NO '''she-bang line''' so this Bash at the top of the shell script ; therefore, it is being run in the '''Bourne Shell''' (i.e. the <u>current shell</u>).<br><br>Let's '''add ''' a '''she-bang line ''' to the top of this shell script file so it <u>forces </u> the shell script to run in the '''Bash Shell ''' instead of the Bourne Shell.<br><br>
# Use a text editor to edit the shell script called '''hello.bash'''<br><br>
# Add the following line to the TOP of the file:<br><span style="font-family:courier;">#!/bin/bash</span><br><br>