From f880376290de857118af28e03e69378815821451 Mon Sep 17 00:00:00 2001 From: xiota Date: Sat, 7 Jul 2018 21:07:08 -0700 Subject: [PATCH] Find real script directory when run from symlink. --- gear360pano.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gear360pano.sh b/gear360pano.sh index 5f7a3e6..1a330ab 100755 --- a/gear360pano.sh +++ b/gear360pano.sh @@ -8,7 +8,9 @@ # http://stackoverflow.com/questions/59895/can-a-bash-script-tell-which-directory-it-is-stored-in -DIR=$(dirname `which $0`) +WHICH=`which $0` +DIR=$(dirname `readlink -f $WHICH`) + SCRIPTNAME=$0 GALLERYDIR="html" OUTDIR="$DIR/$GALLERYDIR/data"