Open main menu

CDOT Wiki β

Changes

Tutorial10: Shell Scripting - Part 1

704 bytes added, 07:51, 19 July 2020
INVESTIGATION 2: USING VARIABLES IN SHELL SCRIPTS
# Add the following line to the bottom of the file:<br><span style="font-family:courier;">echo "The current shell you are using is: $SHELL"</span><br><br>
# Save your editing changes and exit your text editor.<br><br>
# Issue the following linux command to change to the c-shell (a different shell than the default Bash):<br><span style="color:blue;font-weight:bold;font-family:courier;">csh</span># Issue the following linux command confirm you are in the c-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 c-shell.<br><br># Run your hello.bash shell script. What shell does the shell script indicate is running? This is because of the shebang line indicating to run the shell script in the Bash shell although you ran this script within the c-shell.<br><br># Enter the following linux command to return to your Bash shell: <span style="color:blue;font-weight:bold;font-family:courier;">exit</span><br><br>
In the next investigation, you will ...
13,420
edits