Fix shell script current dir bad substition errors
authorKai Li <kaili_kloud@163.com>
Wed, 19 Mar 2014 15:20:09 +0000 (23:20 +0800)
committerEvan Shelhamer <shelhamer@imaginarynumber.net>
Wed, 19 Mar 2014 19:31:38 +0000 (12:31 -0700)
data/cifar10/get_cifar10.sh
data/ilsvrc12/get_ilsvrc_aux.sh
data/mnist/get_mnist.sh
scripts/build_and_deploy_docs.sh
tools/extra/parselog.sh

index ac72b1f..ea99893 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env sh
 # This scripts downloads the CIFAR10 (binary version) data and unzips it.
 
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+DIR="$(readlink -f $(dirname "$0"))"
 cd $DIR
 
 echo "Downloading..."
index 9ba90d8..1c6d3e6 100755 (executable)
@@ -6,7 +6,7 @@
 # - synset ids and words
 # - the training splits with labels
 
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+DIR="$(readlink -f $(dirname "$0"))"
 cd $DIR
 
 echo "Downloading..."
index b119b42..8295acd 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env sh
 # This scripts downloads the mnist data and unzips it.
 
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+DIR="$(readlink -f $(dirname "$0"))"
 cd $DIR
 
 echo "Downloading..."
index 85121b6..fdb75db 100755 (executable)
@@ -15,7 +15,7 @@ MSG=`git log --oneline -1`
 
 if [[ $BRANCH = 'master' ]]; then
     # Find the docs dir, no matter where the script is called
-    DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+    DIR="$(readlink -f $(dirname "$0"))"
     DOCS_SITE_DIR=$DIR/../docs/_site
 
     # Make sure that docs/_site tracks remote:gh-pages.
index 39927a6..6d65f48 100755 (executable)
@@ -4,7 +4,7 @@
 # another one caffe.log.loss that contains the loss computed during the training
 
 #get the dirname of the script
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+DIR="$(readlink -f $(dirname "$0"))"
 
 if [ "$#" -lt 1 ]
 then