diff options
Diffstat (limited to 'bash/bashrc.d/path.bash')
-rw-r--r-- | bash/bashrc.d/path.bash | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/bash/bashrc.d/path.bash b/bash/bashrc.d/path.bash index 658d41a9..961e84cd 100644 --- a/bash/bashrc.d/path.bash +++ b/bash/bashrc.d/path.bash @@ -57,6 +57,11 @@ path() { "$FUNCNAME" "$dir" >&2 return 1 fi + if [[ $dir == *:* ]] ; then + printf 'bash: %s: Cannot add insert directory %s with colon in name\n' \ + "$FUNCNAME" "$dir" >&2 + return 1 + fi if path check "$dir" ; then printf 'bash: %s: %s already in PATH\n' \ "$FUNCNAME" "$dir" >&2 @@ -81,6 +86,11 @@ path() { "$FUNCNAME" "$dir" >&2 return 1 fi + if [[ $dir == *:* ]] ; then + printf 'bash: %s: Cannot append directory %s with colon in name\n' \ + "$FUNCNAME" "$dir" >&2 + return 1 + fi if path check "$dir" ; then printf 'bash: %s: %s already in PATH\n' \ "$FUNCNAME" "$dir" >&2 |