Changes

Jump to: navigation, search

Tutorial10: Shell Scripting - Part 1

38 bytes added, 10:42, 17 February 2021
INVESTIGATION 2: USING VARIABLES IN SHELL SCRIPTS
# Issue the following linux command to add your current directory to the '''PATH''' environment variable:<br><span style="color:blue;font-weight:bold;font-family:courier;">PATH=$PATH:.</span><br><br>
# Issue the following linux command to confirm that the current directory "." has been added to the PATH environment variable:<br><span style="color:blue;font-weight:bold;font-family:courier;">echo $PATH</span><br><br>
# Run Issue the '''hello.bash''' by just following to run your Bash shell script just by name (i.e. to not use :<br><span style="color:blue;font-weight:bold;font-family:courier;">hello.bash</ prior to shell script name).span><br><br>The Did your Bash shell script should run just by name.?<br><br>
# Exit your Matrix session, and log back into your Matrix session.<br><br>
# Re-run the '''hello.bash''' shell script by just using the name.<br><br>What did you notice?<br><br>The setting of the '''PATH''' environment variable only worked in the current session only.<br>If you exit the current Matrix session, then the recently changed settings for environment variables will be lost.<br>You will in a <u>future</u> tutorial how to set environment variables in '''start-up''' files.<br><br>Let's create a Bash shell script that contain '''user-created variables'''.<br><br>
13,420
edits

Navigation menu