December 2015
Beginner
306 pages
5h 2m
English
Command line arguments are required for the following reasons:
Check the following command line:
student@ubuntu:~$ my_program arg1 arg2 arg3
If my_command is a bash Shell script, then we can access every command line positional parameters inside the script as follows:
$0 would contain "my_program" # Command $1 would contain "arg1" # First parameter $2 would contain "arg2" # Second parameter $3 would contain "arg3" # Third parameter
The following is the summary of positional parameters:
|
$0 |
Shell script ... |