0

Travis CI seems to be misbehaving very oddly since yesterday. I know they pushed out an update on the 21st June 2017 to Travis but this issue only started happening yesterday to me causing a total mess of one of my repo's but luckily I reverted back to the last commit where everything was still OK and have done no more commits since then just been running tests on a different test repo all day today and it's still broken.

During my Travis build process I run a number of bash scripts that do various things like create files based on templates. But since yesterday the output of any echo or printf see's any "n" character as a line break \n

For example:

This simple printf in my bash script:

for line in $(cat $INPUT1); do
printf "\t\"~${line}\"\t\t$ACTION1\n" >> whateverfile.txt

My inputs are defined earlier as:

ACTION1="0;"
INPUT1=$TRAVIS_BUILD_DIR/myfile.txt

Travis breaks the output of any ${line} which contains an "n" in the output.

So for example a ${line} from the cat statement that contains the word bingbot for instance should output as follows:

"~bingbot" 0;

but Travis is doing this because it see's any n character as a line break, this below is the output of running the script with sh -x ./scriptname

bi"\t\t0;\n

+ printf \t"~gbot

and in the actual output file this is what travis prints with printf

bi"     0;
"~gbot

Anyone else seeing this behavior? I have tweeted and emailed them but no response yet. Tried various things to fix it and in some cases capitalising all my variables, inputs, filenames and directories fixes it but that is not a solution. What has Travis done to simple bash? or am I missing something. This has worked perfectly for over a year.

Note: my default scripts all run using #!/bin/bash I have changed them to use #!/bin/sh but it is still happening.

MitchellK
  • 2,322
  • 1
  • 16
  • 25

1 Answers1

0

I solved this thanks to the help of a number of people in this question - Ubuntu (14 & 16) Bash errors with printf loops from input containing lowercase "n" characters

It wasn't a Travis CI issue after all. It's all explained in the link above.

MitchellK
  • 2,322
  • 1
  • 16
  • 25