Shell script misidentifies its own name
Brought to you by:
jeugenepace
It appears the shell script incorrectly assumes its
name will always be the first thing on the command
line. This isn't always the case when run via source:
~/downloads/doctorj-5.1.0$ source bin/doctorj
/Users/elharo/Projects/xom/src
dirname: illegal option -- b
usage: dirname path
usage: dirname path
Exception in thread "main"
java.lang.NoClassDefFoundError: org/incava/doctorj/DoctorJ
Logged In: YES
user_id=316860
I'm adding better detection of that in the next release.
The problem with sh and bash is that they don't pass $0 (or
$1, depending on how you look at it), which we need in
order to figure out where the jar file is.
Trying to source that script in csh or tcsh will result in
syntax errors, so that's not an issue, and oddly (or maybe
not) zsh passes $0 correctly.