Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow jvmtop.sh to be called from a symlink #95

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

allow jvmtop.sh to be called from a symlink #95

wants to merge 1 commit into from

Conversation

muxator
Copy link

@muxator muxator commented Dec 13, 2016

With this change jvmtop.sh can be symlinked in a directory in the PATH and called from anywhere.

$  ls -l /usr/local/bin/jvmtop.sh
lrwxrwxrwx 1 root root 32 Dec 13 21:46 /usr/local/bin/jvmtop.sh -> /opt/jvmtop with space/jvmtop.sh

Before the change:

$ jvmtop.sh
Error: Could not find or load main class com.jvmtop.JvmTop

After the change it works, even if the script is a symlink, and if spaces are contained in the path.

Source for the change:
http://stackoverflow.com/questions/59895/getting-the-current-present-working-directory-of-a-bash-script-from-within-the-s#comment54598418_246128

With this change jvmtop.sh can be symlinked in a directory in the PATH and called from anywhere.

#  ls -l /usr/local/bin/jvmtop.sh
lrwxrwxrwx 1 root root 32 Dec 13 21:46 /usr/local/bin/jvmtop.sh -> /opt/jvmtop with space/jvmtop.sh

Before the change:
# jvmtop.sh
Error: Could not find or load main class com.jvmtop.JvmTop

After the change it works, even if the script is a symlink, and if spaces are contained in the path.

Source for the change:
http://stackoverflow.com/questions/59895/getting-the-current-present-working-directory-of-a-bash-script-from-within-the-s#comment54598418_246128
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant