Page 1 of 1

Shell command cannot have 2 or more pipes.

Posted: Monday 4th April 2022 12:54am
by ak2766
I'm still learning the Gambas ropes so bear with me.

In trying to calculate a HMAC for my application, I tried the following:
smsHMAC = Shell "echo -n 'timestamp\nnonce\nPOST\n/v2/sms\napi.smsglobal.com\n443\n\n' | openssl dgst -sha256 -hmac $(head -1 ~/.smsglobal) -binary | base64"
But I keep getting an error. However, if I break the command into 2 parts, with each part having a single pipe, it works.

Is there a limitation to the number of pipes the Shell command will accept or am I doing something wrong? I bet there is a better way to do this, but being new to Gambas, I'm still earning.

Cheers,
ak.

Re: Shell command cannot have 2 or more pipes.

Posted: Monday 4th April 2022 9:57am
by ak2766
Problem resolved.

I'm on Ubuntu 20.04 and on this version, the version of Gambas in the repos is v3.14.3.

After upgrading to v3.17.0, I see there's no such limitation. I did however have ugly font issues that was resolved on comment #3 from this really old post.

I'm starting to like Gambas a lot.

Cheers,
ak.