diff options
Diffstat (limited to '.bashrc')
-rw-r--r-- | .bashrc | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -14,8 +14,10 @@ diralias () { # so this way, albeit complicated, convenient traversal is achieved # XXX could -G be used instead? complete -o nospace -C \ - "f(){ find \"${1%%* }/\${2%\${2##*/}}\" -maxdepth 1 -type d -name \"\${2##*/}*\" \ - -printf \"\${2%\${2##*/}}%P\\n\"; }; f" "$(basename "$1")" + "f(){ test \"\$3\" != \"$(basename "$1")\" || \ + find \"${1%%* }/\${2%\${2##*/}}\" -mindepth 1 -maxdepth 1 -type d \ + -name \"\${2##*/}*\" -printf \"\${2%\${2##*/}}%P\\n\"; }; f" \ + "$(basename "$1")" } _linkalias () { |