diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2015-05-31 00:11:06 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2015-05-31 00:11:06 +1200 |
commit | 33949ad4605952107a314ce498db1fc1477440e2 (patch) | |
tree | 0e7d90c362473909765a4eab55c7f0dc751ca8cf /bash/bashrc.d | |
parent | Don't clobber $_ (changed my mind) (diff) | |
download | dotfiles-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)
Diffstat (limited to 'bash/bashrc.d')
-rw-r--r-- | bash/bashrc.d/gnupg.bash | 3 | ||||
-rw-r--r-- | bash/bashrc.d/scp.bash | 3 |
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 |