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

fix issue #8 #9

Closed
wants to merge 1 commit into from
Closed

fix issue #8 #9

wants to merge 1 commit into from

Conversation

iambocai
Copy link

[root@host bin]# dirname control.sh
.
[root@host bin]# dirname .
. <<----------------- T-T
[root@host bin]# HOMEDIR=$(cd $(dirname control.sh)/../ && pwd)
[root@host bin]# echo $HOMEDIR
/opt/cronicle <<----------------- : )

@jhuckaby
Copy link
Owner

Thank you for this PR. I actually went with an alternate fix, which is to properly calculate the full absolute path of the control script, so then dirname works properly. Example:

SCRIPT=`perl -MCwd -le 'print Cwd::abs_path(shift)' "$0"`
DIR=`dirname $SCRIPT`
HOMEDIR=`dirname $DIR`
cd $HOMEDIR

Yes this requires Perl, alas, but that is typically installed on most Linux systems by default.

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.

2 participants