Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Passing 10 arguments from pipeline to script

Peter Spencer
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 17, 2024

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.

1 answer

1 vote
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 18, 2024

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

echo "The tenth argument is: ${10}"

Do you get no output at all for this parameter?

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events