diff options
author | Martin Schwenke <martin@meltin.net> | 2016-06-29 17:36:05 +1000 |
---|---|---|
committer | Amitay Isaacs <amitay@samba.org> | 2016-07-06 04:28:09 +0200 |
commit | f227c26178c2eaf3fae49f32a90ec905f85005f4 (patch) | |
tree | f03ba950aceb801a7cad29fa6957c98868673454 /ctdb/config/debug-hung-script.sh | |
parent | 850863a15ef462b4df53d5bdad3c80dbaf569089 (diff) | |
download | samba-f227c26178c2eaf3fae49f32a90ec905f85005f4.tar.gz |
ctdb-scripts: Update script boilerplate to avoid shellcheck warnings
* Assign the output of dirname to temporary variable to avoid word
splitting when directory name contains whitespace
* Drop export of CTDB_BASE to avoid masking broken return value -
functions file does the export anyway
* Quote path when including functions file
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb/config/debug-hung-script.sh')
-rwxr-xr-x | ctdb/config/debug-hung-script.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ctdb/config/debug-hung-script.sh b/ctdb/config/debug-hung-script.sh index cef004b5046..921683c4669 100755 --- a/ctdb/config/debug-hung-script.sh +++ b/ctdb/config/debug-hung-script.sh @@ -4,9 +4,9 @@ # for other operating systems. [ -n "$CTDB_BASE" ] || \ - export CTDB_BASE=$(cd -P $(dirname "$0") ; echo "$PWD") + CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD") -. "$CTDB_BASE/functions" +. "${CTDB_BASE}/functions" loadconfig ctdb |