Whenever you execute a shell program, the shell automatically stores the first argument in the special shell variable 1, the second argument in the variable 2, and so on. These special variables—more formally known as positional parameters—are assigned after the shell has done its normal command-line processing (that is, I/O redirection, variable substitution, filename substitution, and so on). positional parameters look like $0 .. $9 and $#. -- ./script.sh 1 2 3 4 5 6 7 8 9 a b script.sh echo "fileName is $0 and first parameter is $1" echo "filename is $0 and last parameter is ${11}"