Changes

Jump to: navigation, search

Tutorial10: Shell Scripting - Part 1

174 bytes removed, 18:04, 17 February 2021
INVESTIGATION 2: USING VARIABLES IN SHELL SCRIPTS
# It is a good idea to rename your shell script to include an '''extension''' to<br>explain that this is '''Bash Shell script''' file (referred to as a "''portable Bash shell script''"). <br>Issue the following linux command to rename your shell script file:<br><span style="color:blue;font-weight:bold;font-family:courier;">mv hello hello.bash</span><br><br>
# Run your renamed shell script for confirmation by issuing:<br><span style="color:blue;font-weight:bold;font-family:courier;">./hello.bash</span><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># Issue the following Linux command to confirm you have returned to the Bash shell: <span style="color:blue;font-weight:bold;font-family:courier;">echo $SHELL</span><br><br>Let's use some '''ENVIRONMENT variables''' in our Bash Shell script.<br><br>
# Use a text editor to edit the shell script called '''hello.bash'''<br><br>
# Add the following lines to the bottom of the file:<br><span style="font-family:courier;">echo<br>echo "The current directory location is: $PWD"<br>echo "The current user home directory is: $HOME<br>echo</span><br><br>
13,420
edits

Navigation menu