The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events