aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2014-02-10 10:54:53 +1300
committerTom Ryder <tom@sanctum.geek.nz>2014-02-10 10:54:53 +1300
commit95012843e6dc9197bbcecf77eb655cbed370b88d (patch)
tree64a8b96d2b910a93fc0ff807208cb61a573bf6d3 /bash
parentAlways use -H switch for sudo(8) (diff)
downloaddotfiles-95012843e6dc9197bbcecf77eb655cbed370b88d.tar.gz
dotfiles-95012843e6dc9197bbcecf77eb655cbed370b88d.zip
Use -r test consistently rather than -f
Implicitly check whether file exists and is legible
Diffstat (limited to 'bash')
-rw-r--r--bash/bashrc2
-rw-r--r--bash/bashrc.d/mysql.bash2
2 files changed, 2 insertions, 2 deletions
diff --git a/bash/bashrc b/bash/bashrc
index abfc6267..8c74c136 100644
--- a/bash/bashrc
+++ b/bash/bashrc
@@ -80,7 +80,7 @@ fi
# Load any supplementary scripts
if [[ -d $HOME/.bashrc.d ]]; then
for config in "$HOME"/.bashrc.d/*; do
- [[ -f $config ]] && source "$config"
+ [[ -r $config ]] && source "$config"
done
fi
unset -v config
diff --git a/bash/bashrc.d/mysql.bash b/bash/bashrc.d/mysql.bash
index fb1f7126..488fb02c 100644
--- a/bash/bashrc.d/mysql.bash
+++ b/bash/bashrc.d/mysql.bash
@@ -15,7 +15,7 @@ fi
#
mysql() {
local config="$HOME"/.mysql/"$1".cnf
- if [[ -f $config ]]; then
+ if [[ -r $config ]]; then
shift
command mysql --defaults-extra-file="$config" "$@"
else