13,420
edits
Changes
→Using Variables in Shell Scripts
Data can be stored and removed within a variable using an equal sign.<br>The '''read''' command can be used to prompt the user to enter data into a variable.<br>Refer to the diagram on the right-side to see how user-defined variables are assigned data.
'''Positional Parameters'''
A positional parameter is a variable within a shell program; �its value is set from an argument specified on the command line �that invokes the program. �
Positional parameters are numbered and are referred to �with a preceding "$": $1, $2, $3, and so on.
There are a few ways to assign values as positional parameters:�
Use the set command with the values as argument after the set command�
Run a shell script containing arguments
===Using Control Flow Statements in Shell Scripts===