aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2015-05-31 00:11:06 +1200
committerTom Ryder <tom@sanctum.geek.nz>2015-05-31 00:11:06 +1200
commit33949ad4605952107a314ce498db1fc1477440e2 (patch)
tree0e7d90c362473909765a4eab55c7f0dc751ca8cf
parentDon't clobber $_ (changed my mind) (diff)
downloaddotfiles-33949ad4605952107a314ce498db1fc1477440e2.tar.gz
dotfiles-33949ad4605952107a314ce498db1fc1477440e2.zip
Use temp var for $* tests
To shut shellcheck up (SC2048 falsely flagged in contexts where $* not subject to whitespace problems, as is the case here)
-rw-r--r--bash/bashrc.d/gnupg.bash3
-rw-r--r--bash/bashrc.d/scp.bash3
2 files changed, 4 insertions, 2 deletions
diff --git a/bash/bashrc.d/gnupg.bash b/bash/bashrc.d/gnupg.bash
index cfbda514..1544f8a2 100644
--- a/bash/bashrc.d/gnupg.bash
+++ b/bash/bashrc.d/gnupg.bash
@@ -1,6 +1,7 @@
# Wrapper around gpg(1) to stop ``--batch'' breaking things
gpg() {
- case $* in
+ local optstring=$*
+ case $optstring in
*--ed*|*--gen-k*|*--sign-k*)
command gpg --no-batch "$@"
;;
diff --git a/bash/bashrc.d/scp.bash b/bash/bashrc.d/scp.bash
index ee55061f..9acb9894 100644
--- a/bash/bashrc.d/scp.bash
+++ b/bash/bashrc.d/scp.bash
@@ -1,6 +1,7 @@
# Wrap scp to check for missing colons
scp() {
- if (($# >= 2)) && [[ $* != *:* ]] ; then
+ local optstring=$*
+ if (($# >= 2)) && [[ $optstring != *:* ]] ; then
printf 'bash: %s: Missing colon, probably an error\n' \
"$FUNCNAME" >&2
return 2