Quote variables correctly in case they contain special characters. Run Java with exec so the shell doesn't stick around. --- ner-gui.sh.orig 2020-11-17 05:05:22.000000000 -0600 +++ ner-gui.sh 2021-11-24 10:39:27.000000000 -0600 @@ -1,4 +1,4 @@ #!/bin/sh -scriptdir=`dirname $0` +scriptdir="`dirname "$0"`" -java -mx700m -cp "$scriptdir/stanford-ner.jar:lib/*" edu.stanford.nlp.ie.crf.NERGUI +exec java -mx700m -cp "$scriptdir/stanford-ner.jar:lib/*" edu.stanford.nlp.ie.crf.NERGUI --- ner.sh.orig 2020-11-17 05:05:22.000000000 -0600 +++ ner.sh 2021-11-24 10:39:47.000000000 -0600 @@ -1,4 +1,4 @@ #!/bin/sh -scriptdir=`dirname $0` +scriptdir="`dirname "$0"`" -java -mx700m -cp "$scriptdir/stanford-ner.jar:$scriptdir/lib/*" edu.stanford.nlp.ie.crf.CRFClassifier -loadClassifier $scriptdir/classifiers/english.all.3class.distsim.crf.ser.gz -textFile $1 +exec java -mx700m -cp "$scriptdir/stanford-ner.jar:$scriptdir/lib/*" edu.stanford.nlp.ie.crf.CRFClassifier -loadClassifier "$scriptdir"/classifiers/english.all.3class.distsim.crf.ser.gz -textFile "$1"