Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

while loop failing without output



I'm trying to run the following pipeline code that is failing without an output. 

I've tried running it via CLI in a container and it works fine.

Can someone explain what's wrong?

- buildJobs=$(wc -l build-ids.txt | awk '{print $1}')
- inactiveJobs=0
while [ $inactiveJobs -lt $buildJobs ]; do inactiveJobs=$(aws codebuild batch-get-builds --ids $(cat build-ids.txt| tr '\n' ' ' | tr -d '"') | jq '.builds[]'.buildStatus | grep -c -v IN_PROGRESS); echo $inactiveJobs; sleep 10; done



1 answer

I am in a similar boat where I have a while loop failing on a bash script that I know works locally. I get the error: bash: while: command not found. Is a while loop something that can be installed in the pipeline (if yes how?), or is it something purposefully not allowed?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

📣 Calling Bitbucket Data Center customers to participate in research

Hi everyone, Are you Bitbucket DC customer? If so, we'd love to talk to you! Our team wants to dive deep to understand your long-term plans regarding Bitbucket DC and Atlassian Cloud. Do you plan...

226 views 2 5
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you