Shell command cannot have 2 or more pipes.

Post

Posted
Rating:
#1 (In Topic #838)
Trainee
I'm still learning the Gambas ropes so bear with me.

In trying to calculate a HMAC for my application, I tried the following:

Code (gambas)

  1. 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"
  2.  

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.
Online now: No Back to the top

Post

Posted
Rating:
#2
Trainee
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.
Online now: No Back to the top
1 guest and 0 members have just viewed this.