awk in pipeline script works differently from local version Edited

I use awk command  to parse pid of my server process. So i have next command with its output:изображение.png

But it does not work. To know reasons of it i gизображение.pngo step back:изображение.pngизображение.png

Here we can see, that awk statement have no affect result.

At the same time, exactly this command  on server  works properly.

изображение.pngSo how cann i solve this issue? What i am doing wrong?

1 answer

0 vote

Can you double check the output of "ps aux | grep '/[r]ace_bot/' | awk '{print$2}'" on Pipelines? You've got everything else to compare except that at the moment.

Also you may wanna check that your PIDs are still output as expected if you use:

ps aux | grep '/[r]ace_bot/' | awk '{print $2}' | xargs echo

Sorry for this, first version screen have not been published(

I edited question.

Here is that screen, and i don't know, why it is not workingизображение.png

Hmmm. Nothing stands out as suspicious. Is the issue reproduced if you run this inside of a Docker environment? Pipelines runs in Docker, so it should be an identical environment here. https://confluence.atlassian.com/bitbucket/debug-your-pipelines-locally-with-docker-838273569.html

Actually. The 'print $2' doesn't seem to be working as expected here. That seems like a candidate.

What Docker image are you using in Pipelines?

As I understand what image docker, I use

python:3.5.1

 At the same time, at the first command in my scipt i connect to my remote server and then all commands execute on server side.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

1,747 views 1 5
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you