Changes

Jump to: navigation, search

Tutorial10: Shell Scripting - Part 1

107 bytes added, 12:38, 5 March 2021
INVESTIGATION 2: USING VARIABLES IN SHELL SCRIPTS
# Use a text editor to '''modify''' your Bash shell script called '''user-variables.bash'''<br><br>
# '''Insert''' the following lines immediately <u>'''below'''</u> the '''she-bang''' line:<br><span style="font-family:courier;font-weight:bold;">age=25<br>readonly age</span><br><br>
# Save your editing changes and exit your text editor.<br><br>[[Image:user-variable2.png|thumb|right|275px|Trying to change the value of a '''read-only''' variable'''.]]
# Issue the following to run the user-variables.bash Bash shell script:<br><span style="color:blue;font-weight:bold;font-family:courier;">./user-variables.bash</span><br><br>What do you notice when you try to change the age variable? Why?<br><br>Let's use '''positional parameters''' and '''special parameters''' in a Bash shell script.<br><br>
# Use a text editor to create a file called '''parameters.bash'''<br><br>
13,420
edits

Navigation menu