https://issues.apache.org/bugzilla/show_bug.cgi?id=55994

Regarding all shells, the top of the jmeter.sh script already specified
#! /bin/sh

As such the script can be call by within unix shell.


Thanks,
James Liang


-----Original Message-----
From: sebb [mailto:seb...@gmail.com] 
Sent: Saturday, January 11, 2014 4:17 PM
To: dev@jmeter.apache.org
Subject: Re: enhancement to jmeter.sh startup script

On 12 January 2014 00:00, James Liang <jli...@andera.com> wrote:
> Hi guys,
>
> The bin/jmeter.sh 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 jmeter.

Thanks - could you add that to a Bugzilla issue?

Also, does that fix work for all shells?
It looks like it might be specific to bash.

> ----------
>
> # resolve the true full path (e.g. called from outside of bin, called 
> via symlinks, and etc.) SOURCE="${BASH_SOURCE[0]}"
> 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 done DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
>
> echo "start jmeter.sh from $DIR"
> cd "$DIR"
>
> # the rest of the jmeter.sh scripts
> # i.e.  JMETER_OPTS="" ...
>
>
>
> Thanks,
> James Liang
>
>

Reply via email to