diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2013-11-04 13:21:10 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2013-11-04 13:21:10 +1300 |
commit | d1ba934f3b9dcf276d200e9b2fd2ec3ae465bb36 (patch) | |
tree | 0821fcb5440cb582458acbb3f326c28d32fb0ca0 | |
parent | Wrote a function called 'vis' for editing scripts (diff) | |
download | dotfiles-d1ba934f3b9dcf276d200e9b2fd2ec3ae465bb36.tar.gz dotfiles-d1ba934f3b9dcf276d200e9b2fd2ec3ae465bb36.zip |
Bash 2.0 compatible syntax; type -P is new
-rw-r--r-- | bash/bashrc.d/vim.bash | 3 |
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 |