Passing 10 arguments to a bash script from the pipeline but only nine ever make it through. Any ideas are welcome, unable to find anything documented.
Hi Peter and welcome to the community!
How are you referencing the 10th argument in your script?
You can use $1, $2, etc for arguments up to $9, but for arguments from 10 onwards you need to use curly braces.
For example, instead of
echo "The tenth argument is: $10"
you will need to use
echo "The tenth argument is: ${10}"
Otherwise, the shell will give you the first parameter followed by a zero. Is this what you see when you run this script?
If you are referencing this argument as ${10} and still see issues, can you please explain what do you see when you use for example
Do you get no output at all for this parameter?
Kind regards,Theodora
It looks like you're new here. Sign in or register to get started.