Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

awk in pipeline script works differently from local version

valt25 April 5, 2018

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
Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 5, 2018

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.

Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 5, 2018

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
valt25 April 5, 2018

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

Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 5, 2018

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

Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 5, 2018

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

Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 5, 2018

What Docker image are you using in Pipelines?

valt25 April 6, 2018

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
TAGS
AUG Leaders

Atlassian Community Events