0

I have the following:

VERSION=$(curl -Is https://qa.me.com.br | sed -n '/^x-powered-by:/Ip' | sed '/x-powered-by:/I s/x-powered-by: //Ig')

Expected variable result (but it has one more character that broke my result):

MEWeb - QA - 267_4_2548

After, I'm showing by the following:

echo "##teamcity[progressMessage 'Version is $VERSION']"

Expected (without '*'):

*##teamcity[progressMessage 'Version is MEWeb - QA - 267_4_2548']

Actual:

']##teamcity[progressMessage 'Version is MEWeb - QA - 267_4_2548

I don't know what is breaking my result. Thanks for help and sorry for my english!

Lucas Neves
  • 113
  • 1
  • 8

2 Answers2

1

Add

| tr -d '\r'

to the end of the curl command (just before the ")").

simon3270
  • 722
  • 1
  • 5
  • 8
0

The response has a carriage return. When you get the VERSION, put it in a file. echo $VERSION > test.txt

Now, to see the hidden characters, use: cat -v test.txt

You'll see: MEWeb - QA - 267_4_2548**^M**

You need to handle that character, which is causing the trouble.