Skip to content
Advertisement

Unable to substitute a custom variable in Authorization header value in curl

I am trying to use $timestamp and generate hash. I see $timestamp value is not getting assigned and it’s always same.

My request:–

JavaScript

Output[Request Authorization headers]

JavaScript

20180701T12:33:56+0000 is the correct value which i want to get substituted in ‘$(echo -n $timestamp’ but it’s not happening. $timestamp is not changing at all after the curl command execution.

To Test:– I initially assigned 0 to timestamp. Executed the above curl command. checked echo $timestamp, it is still same[0].

I am new to linux shell. Any help will be highly appreciated.

Advertisement

Answer

It becomes simple when you clean it up and break it down into multiple lines:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement