You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by bu...@apache.org on 2007/09/28 01:09:10 UTC
DO NOT REPLY [Bug 21695] - Unix jmeter start script assumes it is on PATH, not a link
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=21695>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=21695
------- Additional Comments From mdeeks@ea.com 2007-09-27 16:09 -------
(In reply to comment #0)
> If I don't want to alter my PATH envariable, then it makes sense to symbolic
> link the jmeter startup script to someplace already in my PATH. But `dirname $0`
> finds the symbol's location. Here is a fixed script (tested linux, solaris)
>
> #! /bin/sh
> #java -Xincgc -jar `dirname $0`/ApacheJMeter.jar "$@"
> truedirname() {
> if test -L $0 ; then
> x=`/bin/ls -l $0`
> for i in $x ; do
> :
> done
> case "$i" in
> /*) x=`dirname $i` ;;
> *) x=`dirname $0`/`dirname $i` ;;
> esac
> else
> msg="$msgd"
> x=`dirname $0`
> fi
> here=`pwd`
> cd $x 2>&1 > /dev/null
> pwd
> cd $here 2>&1 > /dev/null
> }
>
> java -Xincgc -jar `truedirname $0`/ApacheJMeter.jar "$@"
>
> I don't claim this is elegant... but it works for me.
A better way to do this is to use readlink like so:
java -Xincgc -jar $(dirname $(readlink $0)) "$@"
Readlink was originally a BSD utility, but I believe it exists in most, if not
all, Linux distos. I haven't found one yet that doesn't have it... even some of
our older RHEL3 servers have it.
P.S. the backticks ` are deprecated in Bash now. The $( ) syntax is preferred
instead.
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org