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 votes

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.

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


 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
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

657 views 5 9
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