I am trying to use $timestamp and generate hash. I see $timestamp value is not getting assigned and it's always same.
My request:--
curl -H "Authorization:EG1-HMAC-SHA256;timestamp=$(date +%Y%m%dT%H:%M:%S+0000);nonce=`cat /proc/sys/kernel/random/uuid`;signature=$(echo -n $timestamp | openssl dgst -binary -sha256 -hmac '+abhishek' | openssl enc -base64)" https://test.com/abcd/v1/test/123/impulse -vv
Output[Request Authorization headers]
Authorization:EG1-HMAC-SHA256;timestamp=20180701T12:33:56+0000;nonce=8ed3eddf-27ac-4f19-ba81-0ecd07aeb50a;signature=6vMTTitxbU0/3DRXAEPej4HyqQTG+V/F5NLGNcqG2ys=
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.