Shell Parameters

ParametersFunction
$1-$9Represent positional parameters for arguments one to nine
${10}-${n}Represent positional parameters for arguments after nine
$0Represent name of the script
$∗Represent all the arguments as a single string
$@Same as $∗, but differ when enclosed in (“)
$#Represent total number of arguments
$$PID of the script
$?Represent last return code

Example:

Linux Shell Scripting parameters 1

Look at the above snapshot, this is the script we have written to show the different parameters.

Linux  Script parameters 2

Look at the above snapshot, we have passed arguments 1, 5, 90. All the parameters show their value when script is run.


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *