Shell command cannot have 2 or more pipes.

New to Gambas? Post your questions here. No question is too silly or too simple.
Post Reply
ak2766
Posts: 4
Joined: Sunday 3rd April 2022 4:59am
Location: Melbourne, Australia

Shell command cannot have 2 or more pipes.

Post by ak2766 » Monday 4th April 2022 12:54am

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.

ak2766
Posts: 4
Joined: Sunday 3rd April 2022 4:59am
Location: Melbourne, Australia

Re: Shell command cannot have 2 or more pipes.

Post by ak2766 » Monday 4th April 2022 9:57am

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.

Post Reply