diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2015-06-05 23:07:49 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2015-06-05 23:07:49 +1200 |
commit | 841e1d85b9c731c6cd6b226f19fe2b9d94831e87 (patch) | |
tree | 7f033faf59879afa824f7341fca151699c7693aa /bash/bashrc.d | |
parent | Don't allow dirs with : in name (diff) | |
download | dotfiles-841e1d85b9c731c6cd6b226f19fe2b9d94831e87.tar.gz dotfiles-841e1d85b9c731c6cd6b226f19fe2b9d94831e87.zip |
Don't print empty line for empty PATH
Diffstat (limited to 'bash/bashrc.d')
-rw-r--r-- | bash/bashrc.d/path.bash | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bash/bashrc.d/path.bash b/bash/bashrc.d/path.bash index 961e84cd..9ecf1e9a 100644 --- a/bash/bashrc.d/path.bash +++ b/bash/bashrc.d/path.bash @@ -39,7 +39,9 @@ path() { list|l) local -a patharr IFS=: read -a patharr < <(printf '%s\n' "$PATH") - printf '%s\n' "${patharr[@]}" + if ((${#patharr[@]})) ; then + printf '%s\n' "${patharr[@]}" + fi ;; # Add a directory to the front of PATH, checking for existence and uniqueness |