Skip to main content
minor formatting
Source Link
bu5hman
  • 4.9k
  • 2
  • 16
  • 29

The problem is if you SET variable by Curlcurl, Grepgrep, Headhead or Tailtail ++ then you will have a NEW Line in the END of your variable.

To remove the NEW Line set your last Curlcurl with $session like:

curl -H "X-RestSvcSessionId: ${session//[$'\t\r\n ']}" -X GET  "http://a.b.c.d:xxxx/api/jobs"

This will remove the new line and tab (if any).

I had same error: check here

The problem is if you SET variable by Curl, Grep, Head or Tail ++ then you will have a NEW Line in the END of your variable.

To remove the NEW Line set your last Curl with $session like:

curl -H "X-RestSvcSessionId: ${session//[$'\t\r\n ']}" -X GET  "http://a.b.c.d:xxxx/api/jobs"

This will remove the new line and tab (if any).

I had same error: check here

The problem is if you SET variable by curl, grep, head or tail ++ then you will have a NEW Line in the END of your variable.

To remove the NEW Line set your last curl with $session like:

curl -H "X-RestSvcSessionId: ${session//[$'\t\r\n ']}" -X GET  "http://a.b.c.d:xxxx/api/jobs"

This will remove the new line and tab (if any).

I had same error: check here

Source Link
Cyborg
  • 141
  • 4

The problem is if you SET variable by Curl, Grep, Head or Tail ++ then you will have a NEW Line in the END of your variable.

To remove the NEW Line set your last Curl with $session like:

curl -H "X-RestSvcSessionId: ${session//[$'\t\r\n ']}" -X GET  "http://a.b.c.d:xxxx/api/jobs"

This will remove the new line and tab (if any).

I had same error: check here