0

In Linux, the below command is working fine. However if a run the same command on the MAC terminal it's giving the error. Could you share your suggestions with me?

First Command:

export CONFIG="
[req]
distinguished_name=dn
[ dn ]
[ ext ]
subjectKeyIdentifier=hash
basicConstraints=CA:TRUE,pathlen:1
keyUsage=critical, keyCertSign, cRLSign"

Second Command:

openssl req -new -x509 -nodes -newkey ec -pkeyopt ec_paramgen_curve:P-256 -pkeyopt ec_param_enc:named_curve \
-keyout root_ca.key -out root_ca.crt -days 1825 \
-subj "/C=US/SS=Something/L=Cary/O=Something/YY=Something/GG=Something Cert-Manager Root CA" -extensions ext -config <(echo "$CONFIG")

Error:

./linkerdInstallationScript.sh: line 24: syntax error near unexpected token `('
./linkerdInstallationScript.sh: line 24: `-subj "/C=US/SS=Something/L=Cary/O=Something/YY=Something/GG=Something Cert-Manager Root CA" -extensions ext -config <(echo "$CACONFIG")'
genpfault
  • 51,148
  • 11
  • 85
  • 139
  • If your Mac is not running Bash, the Bash-only syntax is tripping it up. But you can easily run Bash on the Mac, too. Or just put the config in a file and pass that instead of `<(echo "$CONFIG")` – tripleee Oct 21 '22 at 16:39
  • As a brief aside, https://stackoverflow.com/questions/673055/correct-bash-and-shell-script-variable-capitalization – tripleee Oct 21 '22 at 16:41
  • I tried to run on the bash as well. Still, it gives the same error. – Abhishek Oct 21 '22 at 16:48
  • I'm afraid you probably did something wrong when trying to run Bash. The other suggestion from my earlier comment should still work. – tripleee Oct 21 '22 at 16:50

0 Answers0