1 year ago

#357972

test-img

paprzyx

Solaris 10 Bash redirect output to a file in wrong order

i execute command :

groovy -cp SCRIPTS_DIR SCRIPTS_DIR/build.groovy >>output.txt 2>>error.txt

build.groovy file contains svn command and lot of mvn commands. During execution file output.txt is changing order and some rows are added in middle of output not at the end.

Example of output.txt:

Executing: svn export --revision 108 --force https://svn.server.eu:/svn/TEST/trunk 101
A    /opt/eu/building/jenkins/workspace/test/101
A    /opt/eu/building/jenkins/workspace/test/101/src
A    /opt/eu/building/jenkins/workspace/test/101/src/scripts
A    /opt/eu/building/jenkins/workspace/test/101/src/template
A    /opt/eu/building/jenkins/workspace/test/101/src/template/tools
A    /opt/eu/building/jenkins/workspace/test/101/MVN
A    /opt/eu/building/jenkins/workspace/test/101/MVN/src
A    /opt/eu/building/jenkins/workspace/test/101/MVN/src/main
A    /opt/eu/building/jenkins/workspace/test/101/MVN/src/main/assembly
A    /opt/eu/building/jenkins/workspace/test/101/common
A    /opt/eu/building/jenkins/workspace/test/101/common/py
A    /opt/eu/building/jenkins/workspace/test/101/PLAIN
A    /opt/eu/building/jenkins/workspace/test/101/PLAIN/scripts

After few secunds when mvn commands are executed some of logs are between of rows related to svn export command:

Executing: svn export --revision 108 --force https://svn.server.eu:/svn/TEST/trunk 101
********************************************************************************
*** Check if root POM exists ***************************************************
********************************************************************************
*** Timestamp....................................: 30.03.2022 14:57:53
*** In minute since build start..................: 1
*** Root POM exists: MVN/pom.xml
********************************************************************************
*** Creating source.zip on Software Archive ************************************
********************************************************************************
*** Timestamp....................................: 30.03.2022 14:57:53
*** In minute since build start..................: 1
      [zip] Building zip: /opt/eu/building/jenkins/workspace/test/source101.zip
********************************************************************************
*** Running resolve-props and lock-snapshots ***********************************
********************************************************************************
A    /opt/eu/building/jenkins/workspace/test/101
A    /opt/eu/building/jenkins/workspace/test/101/src
A    /opt/eu/building/jenkins/workspace/test/101/src/scripts
A    /opt/eu/building/jenkins/workspace/test/101/src/template
A    /opt/eu/building/jenkins/workspace/test/101/src/template/tools
A    /opt/eu/building/jenkins/workspace/test/101/MVN
A    /opt/eu/building/jenkins/workspace/test/101/MVN/src
A    /opt/eu/building/jenkins/workspace/test/101/MVN/src/main
A    /opt/eu/building/jenkins/workspace/test/101/MVN/src/main/assembly
A    /opt/eu/building/jenkins/workspace/test/101/common
A    /opt/eu/building/jenkins/workspace/test/101/common/py
A    /opt/eu/building/jenkins/workspace/test/101/PLAIN
A    /opt/eu/building/jenkins/workspace/test/101/PLAIN/scripts

I execute this command on different linux systems and there output.txt is correct. Only on Solaris 10 i have this 'strange' behavior of stdout. Maybe it's related to output buffering but i'm not sure. Any solution for this ?

bash

maven

jenkins

output

solaris

0 Answers

Your Answer

Accepted video resources