Ensure dir always works absolutely.
authorRobin H. Johnson <rjohnson@sitka.bclibraries.ca>
Sun, 4 Nov 2012 16:45:37 +0000 (08:45 -0800)
committerRobin H. Johnson <rjohnson@sitka.bclibraries.ca>
Sun, 4 Nov 2012 16:45:37 +0000 (08:45 -0800)
marc_export_custom/sitka-full-export-bslw.sh
marc_export_custom/sitka-full-export-parallel-bkct.sh
marc_export_custom/sitka-full-export-parallel-ms.sh
marc_export_custom/sitka-full-export-parallel-outlook-wrapper.sh
marc_export_custom/sitka-full-export-parallel.sh
marc_export_custom/stats.sh

index ac249be..e28df9f 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-DIR=`dirname $0`
+DIR=$(readlink -f $(dirname $0))
 #cd /srv/openils/bin
 
 PGUSER=evergreen
index 1636668..ca106c1 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-DIR=`dirname $0`
+DIR=$(readlink -f $(dirname $0))
 #cd /srv/openils/bin
 
 PGUSER=evergreen
index ca4abbb..a736258 100755 (executable)
@@ -1,6 +1,7 @@
 #!/bin/bash
 
-DIR=`dirname $0`
+DIR=$(readlink -f $(dirname $0))
+
 #cd /srv/openils/bin
 
 PGUSER=evergreen
index 0e3d372..4fae518 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 # This is meant to be fire-and-forget
 # Only use it if you trust the output!
-export DIR=`dirname $0`
+export DIR=$(readlink -f $(dirname $0))
 [ -z "${T}" ] && export T=$(date -u +%Y%m%dT%H%M%SZ)
 [ -z "${OUTDIR}" ] && export OUTDIR=$(mktemp --tmpdir -d outlook_export.XXXXXXX)
 cd $OUTDIR
index 5b05ba9..8a34f2a 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-DIR=`dirname $0`
+DIR=$(readlink -f $(dirname $0))
 #cd /srv/openils/bin
 
 PGUSER=evergreen
index 42d4ddc..add09b5 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/bash
-basedir=$(dirname $0)
+basedir=$(readlink -f $(dirname $0))
 files=$(ls *.marc.bz2 *.marc 2>/dev/null |grep -v split |sed 's,\.bz2,,g' | sort | uniq)
 for i in $files; do 
        s=$i.stats