hi,
in a shell script we can refer to the arguments entered by the user on the command line simply with a $1, $2, $3 ... representing the first, second, third ... arguments entered by the user.
however, this works only if there are less than 10 arguments, because for argument 10 - the script interprets $10 as the value that $1 has and then append it with a 0.
in other words, if have a script which simply does an echo of $1, $2 and so on... the output would be like this
Code:
$./myscript foo1 bar2 ... ... arg9 arg10
> Argument1: foo1
> Argument2: bar2
...
...
> Argument10: foo10
Is there a way to tell the shell to interpret '10' as one number instead of evaluating $1 and then appending it with a 0? any guidance will be helpful. thanks!