Category: 3. Shell Parameters
-
read command
The read command allows a user to provide the runtime input. Look at the above snapshot, this is our script using read command. Look at the above snapshot, a user can enter the name in the shell.
-
Shell Scripting Shift Through Parameters
Shift command is a built-in command. Command takes number as argument. Arguments shift down by this number. For example, if number is 5, then $5 become $1, $6 become $2 and so on. Example: The shift command is mostly used when arguments are unknown. Arguments are processed in a while loop with a condition of ((…
-
Shell Parameters
Parameters Function $1-$9 Represent positional parameters for arguments one to nine ${10}-${n} Represent positional parameters for arguments after nine $0 Represent 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…
-
Shell Script Parameters
A bash shell script have parameters. These parameters start from $1 to $9. When we pass arguments into the command line interface, a positional parameter is assigned to these arguments through the shell. The first argument is assigned as $1, second argument is assigned as $2 and so on… If there are more than 9 arguments, then tenth or onwards…