aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-08-11 14:14:06 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-08-11 14:14:06 +1200
commited8902de58c7defcfa116420fdfab8fa09e7fa54 (patch)
tree70a9b66c8f005411f5057ab01db738781b669780 /bash
parentAdd missing -v for `command` call (diff)
downloaddotfiles-ed8902de58c7defcfa116420fdfab8fa09e7fa54.tar.gz
dotfiles-ed8902de58c7defcfa116420fdfab8fa09e7fa54.zip
Test bc(1) for non-POSIX -q
Diffstat (limited to 'bash')
-rw-r--r--bash/bashrc.d/bc.bash3
1 files changed, 3 insertions, 0 deletions
diff --git a/bash/bashrc.d/bc.bash b/bash/bashrc.d/bc.bash
index 1a963708..643678ac 100644
--- a/bash/bashrc.d/bc.bash
+++ b/bash/bashrc.d/bc.bash
@@ -1,3 +1,6 @@
+# This function is only applicable if bc(1) has the non-POSIX -q option
+command bc -q </dev/null >&0 2>&0 || return
+
# Don't print the bc(1) welcome message
bc() {
command bc -q "$@"