Changes

Jump to: navigation, search

Tutorial10: Shell Scripting - Part 1

20 bytes added, 11:06, 5 March 2021
INVESTIGATION 2: USING VARIABLES IN SHELL SCRIPTS
# Issue the '''chmod''' command to add '''execute permissions''' for the user for the '''parameters.bash''' file.<br><br>
# Issue the following to run the '''user-variables.bash''' Bash shell script:<br><span style="color:blue;font-weight:bold;font-family:courier;">./parameters.bash</span><br><br>What happened?<br><br>The values for some of the ''positional parameters'' and ''special parameters'' may NOT be<br>displayed properly since you did NOT provide any '''arguments''' when <u>running</u> your Bash shell script.<br><br>
# Issue the following to run the user-variables.bash Bash shell script with arguments:<br><span style="color:blue;font-weight:bold;font-family:courier;">./parameters.bash 1 2 3 4 5 6 7 8</span><br><br>What do you notice?<br><br>Take some time to view the results and how the ''parameters are '' have changed when using the '''shift ''' command. What do you notice?<br>
:In the next investigation, you will learn to use command substitution and math operates in your shell scripts.
=INVESTIGATION 3: COMMAND SUBSTITUTION / MATH OPERATIONS=
13,420
edits

Navigation menu