You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The which command is different on all operating system from Linux to *BSD and illumos (SunOS). For that reason the following command result in an error:
{code:java}
CERTTOOL=$(which gnutls-certtool || which certtool){code}
Because which on illumos always output the lookup path at stdout.
{code:java}
$ CERTTOOL=$(which gnutls-certtool || which certtool)
$ echo ${CERTTOOL}
no gnutls-certtool in /usr/local/sbin /usr/local/bin /opt/local/sbin /opt/local/bin /usr/sbin /usr/bin /sbin /opt/local/bin/certtool{code}
Affected shell scripts:
pki/generate.ca
pki/generate.client
pki/generate.crl
pki/generate.server
Recommendation:
Replace which with type -p or create a full if-query with output redirection.
The text was updated successfully, but these errors were encountered:
I've attached attached a patch ( [^0001-Posix-compatibility-for-pki-shell-scripts.patch] ) which provide the most portable and POSIX compatibility. If you have any question feel free to contact me.
This patch was generated against either the master or 1.1.0 branch (same thing) and is already released. The development branch is 1.2.0, which already has this kind of portability fix on it.
Thomas on 2017-08-27T10:51:56Z says:
The
which
command is different on all operating system from Linux to *BSD and illumos (SunOS). For that reason the following command result in an error:{code:java}
CERTTOOL=$(which gnutls-certtool || which certtool){code}
Because
which
on illumos always output the lookup path atstdout
.{code:java}
$ CERTTOOL=$(which gnutls-certtool || which certtool)
$ echo ${CERTTOOL}
no gnutls-certtool in /usr/local/sbin /usr/local/bin /opt/local/sbin /opt/local/bin /usr/sbin /usr/bin /sbin /opt/local/bin/certtool{code}
Affected shell scripts:
pki/generate.ca
pki/generate.client
pki/generate.crl
pki/generate.server
Recommendation:
Replace
which
withtype -p
or create a fullif
-query with output redirection.The text was updated successfully, but these errors were encountered: