Changes

Jump to: navigation, search

Tutorial10: Shell Scripting - Part 1

365 bytes added, 08:34, 19 July 2020
INVESTIGATION 2: USING VARIABLES IN SHELL SCRIPTS
# Add the following lines to the bottom of the file:<br><span style="font-family:courier;">#!/bin/bash<br>echo \$0: $0<br>echo \$2: $2<br>echo \$3: $3<br><br>echo \$#: $#<br>echo \$*: $*<br><br>echo shift 2<br>echo \$#: $#<br>echo \$*: $*</span><br><br>
# Save your editing changes and exit your text editor.<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>You shouldn't see any values for the parameters since you did NOT provide any arguments when running the shell script.<br><br># Issue the following to run the user-variables.bashBash 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?
In the next investigation, you will ...
13,420
edits

Navigation menu