aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2013-11-04 13:21:10 +1300
committerTom Ryder <tom@sanctum.geek.nz>2013-11-04 13:21:10 +1300
commitd1ba934f3b9dcf276d200e9b2fd2ec3ae465bb36 (patch)
tree0821fcb5440cb582458acbb3f326c28d32fb0ca0 /bash/bashrc.d
parentWrote a function called 'vis' for editing scripts (diff)
downloaddotfiles-d1ba934f3b9dcf276d200e9b2fd2ec3ae465bb36.tar.gz
dotfiles-d1ba934f3b9dcf276d200e9b2fd2ec3ae465bb36.zip
Bash 2.0 compatible syntax; type -P is new
Diffstat (limited to 'bash/bashrc.d')
-rw-r--r--bash/bashrc.d/vim.bash3
1 files changed, 2 insertions, 1 deletions
diff --git a/bash/bashrc.d/vim.bash b/bash/bashrc.d/vim.bash
index 27758fd2..036dc1da 100644
--- a/bash/bashrc.d/vim.bash
+++ b/bash/bashrc.d/vim.bash
@@ -27,7 +27,8 @@ vis() {
# Check all the commands, if they don't exist, we'll create them
for cmd in "${cmds[@]}"; do
- if ! file=$(type -P "${cmd##*/}"); then
+ file=$(type -p "${cmd##*/}")
+ if [[ ! $file ]]; then
mkdir -p "$HOME"/.local/bin || exit
file="$HOME"/.local/bin/"${cmd##*/}"
fi