summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2014-03-04 16:04:29 +0100
committerJan Pokorný <jpokorny@redhat.com>2014-03-04 16:04:29 +0100
commit59a98093d0dd456ef84fce214fd79ecd15d25d63 (patch)
treee42e6d46608e1ee59c94c96bbfa9fe7470167892
parentb760308984ad4c0a1d55041700024e8160b7755e (diff)
downloaddotfiles-59a98093d0dd456ef84fce214fd79ecd15d25d63.tar.gz
dotfiles-59a98093d0dd456ef84fce214fd79ecd15d25d63.tar.xz
dotfiles-59a98093d0dd456ef84fce214fd79ecd15d25d63.zip
Bash config: make diralias consider symlink'd dirs as well
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
-rw-r--r--.bashrc5
1 files 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")"
}