jmeter-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Liang <>
Subject enhancement to startup script
Date Sun, 12 Jan 2014 00:00:33 GMT
Hi guys,

The bin/ script will fail to launch if it is called via symlink or called from outside
of bin.

Adding the following snippet of script will resolve the true path, cd to it, and then start


# resolve the true full path (e.g. called from outside of bin, called via symlinks, and etc.)
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
  DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
  SOURCE="$(readlink "$SOURCE")"
  [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink,
we need to resolve it relative to the path where the symlink file was located
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

echo "start from $DIR"
cd "$DIR"

# the rest of the scripts
# i.e.  JMETER_OPTS="" ...

James Liang

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message