From: Kai Li Date: Wed, 19 Mar 2014 15:20:09 +0000 (+0800) Subject: Fix shell script current dir bad substition errors X-Git-Tag: submit/tizen/20180823.020014~738^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b5803c627a4e03d9ecf90b22d4e30d31dd814b7a;p=platform%2Fupstream%2Fcaffeonacl.git Fix shell script current dir bad substition errors --- 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