From 9dea81377eafba81a35a90ddbc2c4626f5685eb9 Mon Sep 17 00:00:00 2001 From: Kevin van Zonneveld Date: Wed, 22 Jun 2016 20:36:17 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20unquoted=20variable=20access=20within=20[?= =?UTF-8?q?=20tests=E2=80=A6=20#34?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks to galaktos --- README.md | 2 +- src/ini_val.sh | 2 +- src/megamount.sh | 2 +- src/parse_url.sh | 2 +- src/templater.sh | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b851f00..e9b9df0 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ As of `v1.0.3`, b3bp adds some nice re-usable libraries in `./src`. In order to It's nice to have a Bash package that can be used in the terminal and also be invoked as a command line function. To achieve this the exporting of your functionality *should* follow this pattern: ```bash -if [ "${BASH_SOURCE[0]}" != ${0} ]; then +if [ "${BASH_SOURCE[0]}" != "${0}" ]; then export -f my_script else my_script "${@}" diff --git a/src/ini_val.sh b/src/ini_val.sh index 0d02d07..126325a 100755 --- a/src/ini_val.sh +++ b/src/ini_val.sh @@ -64,7 +64,7 @@ function ini_val() { fi } -if [ "${BASH_SOURCE[0]}" != ${0} ]; then +if [ "${BASH_SOURCE[0]}" != "${0}" ]; then export -f ini_val else ini_val "${@}" diff --git a/src/megamount.sh b/src/megamount.sh index 0c8dd68..9fee3a9 100644 --- a/src/megamount.sh +++ b/src/megamount.sh @@ -57,7 +57,7 @@ function megamount () { ls -al "${target}/" } -if [ "${BASH_SOURCE[0]}" != ${0} ]; then +if [ "${BASH_SOURCE[0]}" != "${0}" ]; then export -f megamount else megamount "${@}" diff --git a/src/parse_url.sh b/src/parse_url.sh index 373a3ad..5c0b7e1 100644 --- a/src/parse_url.sh +++ b/src/parse_url.sh @@ -62,7 +62,7 @@ function parse_url() { fi } -if [ "${BASH_SOURCE[0]}" != ${0} ]; then +if [ "${BASH_SOURCE[0]}" != "${0}" ]; then export -f parse_url else parse_url "${@}" diff --git a/src/templater.sh b/src/templater.sh index b90c98b..d485670 100755 --- a/src/templater.sh +++ b/src/templater.sh @@ -50,7 +50,7 @@ function templater() { fi } -if [ "${BASH_SOURCE[0]}" != ${0} ]; then +if [ "${BASH_SOURCE[0]}" != "${0}" ]; then export -f templater else templater "${@}"