From b5803c627a4e03d9ecf90b22d4e30d31dd814b7a Mon Sep 17 00:00:00 2001 From: Kai Li Date: Wed, 19 Mar 2014 23:20:09 +0800 Subject: [PATCH] Fix shell script current dir bad substition errors --- data/cifar10/get_cifar10.sh | 2 +- data/ilsvrc12/get_ilsvrc_aux.sh | 2 +- data/mnist/get_mnist.sh | 2 +- scripts/build_and_deploy_docs.sh | 2 +- tools/extra/parselog.sh | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/data/cifar10/get_cifar10.sh b/data/cifar10/get_cifar10.sh index ac72b1f..ea99893 100755 --- a/data/cifar10/get_cifar10.sh +++ b/data/cifar10/get_cifar10.sh @@ -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..." diff --git a/data/ilsvrc12/get_ilsvrc_aux.sh b/data/ilsvrc12/get_ilsvrc_aux.sh index 9ba90d8..1c6d3e6 100755 --- a/data/ilsvrc12/get_ilsvrc_aux.sh +++ b/data/ilsvrc12/get_ilsvrc_aux.sh @@ -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..." diff --git a/data/mnist/get_mnist.sh b/data/mnist/get_mnist.sh index b119b42..8295acd 100755 --- a/data/mnist/get_mnist.sh +++ b/data/mnist/get_mnist.sh @@ -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..." diff --git a/scripts/build_and_deploy_docs.sh b/scripts/build_and_deploy_docs.sh index 85121b6..fdb75db 100755 --- a/scripts/build_and_deploy_docs.sh +++ b/scripts/build_and_deploy_docs.sh @@ -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. diff --git a/tools/extra/parselog.sh b/tools/extra/parselog.sh index 39927a6..6d65f48 100755 --- a/tools/extra/parselog.sh +++ b/tools/extra/parselog.sh @@ -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 -- 2.7.4