Changes

Jump to: navigation, search

Tutorial10: Shell Scripting - Part 1

446 bytes added, 10:53, 17 February 2021
INVESTIGATION 2: USING VARIABLES IN SHELL SCRIPTS
# Issue the following to run your Bash shell script just by name:<br><span style="color:blue;font-weight:bold;font-family:courier;">hello.bash</span><br><br>Did your Bash shell script run?<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><span style="color:red;">'''ATTENTION:''' Students will get FRUSTRATED when performing their '''assignment 3''' when their Bash shell scripts have errors. One major cause is the the OUTPUT of their Bash shell script when run does not '''EXACTLY match''' the required output for the correct Bash shell script. This requires that you CAREFULLY '''read''' the requirements of your Bash shell script and create it to the EXACT specifications.<br><br>
# Issue the following Linux command to run a checking script:<br><span style="color:blue;font-weight:bold;font-family:courier;">bash /home/murray.saul/scripts/week10-check-2</span><br><br>
# If you encounter errors, make corrections and '''re-run''' the checking script until you<br>receive a congratulations message, then you can proceed.<br><br>Let's create a Bash shell script that contain '''user-created variables'''.<br><br>
13,420
edits

Navigation menu