From 59a98093d0dd456ef84fce214fd79ecd15d25d63 Mon Sep 17 00:00:00 2001 From: Jan Pokorný Date: Tue, 4 Mar 2014 16:04:29 +0100 Subject: Bash config: make diralias consider symlink'd dirs as well MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jan Pokorný --- .bashrc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.bashrc b/.bashrc index 96b7f99..429b840 100644 --- a/.bashrc +++ b/.bashrc @@ -15,8 +15,9 @@ diralias () { # XXX could -G be used instead? complete -o nospace -C \ "f(){ test \"\$3\" != \"$(basename "$1")\" || \ - find \"${1%%* }/\${2%\${2##*/}}\" -mindepth 1 -maxdepth 1 -type d \ - -name \"\${2##*/}*\" -printf \"\${2%\${2##*/}}%P\\n\"; }; f" \ + find -L \"${1%%* }/\${2%\${2##*/}}\" \ + -mindepth 1 -maxdepth 1 -type d -name \"\${2##*/}*\" \ + -printf \"\${2%\${2##*/}}%P\\n\"; }; f" \ "$(basename "$1")" } -- cgit