Changeset 5075


Ignore:
Timestamp:
04/28/14 06:45:22 (10 years ago)
Author:
hayco.de.jong@huygens.knaw.nl
Message:
  • Invoke 'readlink' with '-f' to recursively traverse symlinks.

When using "which java" to detect the location of the java binary on
platforms using the /etc/alternatives system to allow diversions,
multiple layers of symlinks may need to be traversed to ultimately get
to the desired binary. Use "readlink -f" to get to the canonical name
by following every symlink in every component of the path.

Thus:
$ which java
/usr/bin/java
$ readlink $(which java)
/etc/alternatives/java
$ readlink -f $(which java)
/usr/lib/jvm/java-7-oracle/jre/bin/java

File:
1 edited

Legend:

Unmodified
Added
Removed
  • aai/check-saml-metadata/check_saml_metadata.sh

    r4362 r5075  
    66    if [ ! -z ${JAVA_CMD} ]; then
    77        # slightly hack approach for guessing java
    8         JAVA_CMD=`readlink "${JAVA_CMD}"`
     8        JAVA_CMD=`readlink -f "${JAVA_CMD}"`
    99        # strip java cmd
    1010        JAVA_CMD=`dirname "${JAVA_CMD}"`
Note: See TracChangeset for help on using the changeset viewer.