aboutsummaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-08-18 14:35:16 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-08-18 14:35:16 +1200
commit4f9541f1f5e193e252a890062cd01970f2204619 (patch)
treedf091379910710735c2f8db961ecbcc28cd3dd25 /sh
parentUpdate submodules (diff)
downloaddotfiles-4f9541f1f5e193e252a890062cd01970f2204619.tar.gz
dotfiles-4f9541f1f5e193e252a890062cd01970f2204619.zip
Suppress stderr from command -v checks
Now I remember--old Bash prints failure messages to stderr for this call. That'll be why I was suppressing both streams initially.
Diffstat (limited to 'sh')
-rw-r--r--sh/profile.d/keychain.sh4
-rw-r--r--sh/profile.d/pager.sh2
-rw-r--r--sh/shrc.d/ed.sh2
-rw-r--r--sh/shrc.d/vim.sh2
4 files changed, 5 insertions, 5 deletions
diff --git a/sh/profile.d/keychain.sh b/sh/profile.d/keychain.sh
index a9725bec..55306ad4 100644
--- a/sh/profile.d/keychain.sh
+++ b/sh/profile.d/keychain.sh
@@ -1,11 +1,11 @@
# ssh-askpass setup
-if command -v ssh-askpass >/dev/null ; then
+if command -v ssh-askpass >/dev/null 2>&1 ; then
SSH_ASKPASS=$(command -v ssh-askpass)
export SSH_ASKPASS
fi
# keychain setup
-if command -v keychain >/dev/null ; then
+if command -v keychain >/dev/null 2>&1 ; then
eval "$(TERM=${TERM:-ansi} keychain \
--eval --ignore-missing --quiet id_dsa id_rsa id_ecsda)"
diff --git a/sh/profile.d/pager.sh b/sh/profile.d/pager.sh
index a74e6aa1..f0c4fab4 100644
--- a/sh/profile.d/pager.sh
+++ b/sh/profile.d/pager.sh
@@ -1,6 +1,6 @@
# If we don't have less(1), we'll just use whatever pager the application or
# system deems fit
-command -v less >/dev/null || return
+command -v less >/dev/null 2>&1 || return
# Use less(1) as my PAGER
PAGER=less
diff --git a/sh/shrc.d/ed.sh b/sh/shrc.d/ed.sh
index d13c01c9..4638d2cb 100644
--- a/sh/shrc.d/ed.sh
+++ b/sh/shrc.d/ed.sh
@@ -18,7 +18,7 @@ ed() {
# Execute the ed(1) call, in a wrapper if appropriate and with the
# concluded options
- if [ -t 0 ] && command -v rlwrap >/dev/null ; then
+ if [ -t 0 ] && command -v rlwrap >/dev/null 2>&1 ; then
command rlwrap ed "$@"
else
command ed "$@"
diff --git a/sh/shrc.d/vim.sh b/sh/shrc.d/vim.sh
index fc04c99f..e9174082 100644
--- a/sh/shrc.d/vim.sh
+++ b/sh/shrc.d/vim.sh
@@ -1,5 +1,5 @@
# If Vim exists on the system, use it instead of ex, vi, and view
-command -v vim >/dev/null || return
+command -v vim >/dev/null 2>&1 || return
# Define functions proper
ex() {