X-Git-Url: https://git.grml.org/?a=blobdiff_plain;f=etc%2Fzsh%2Fzshrc;h=24e979b2b8911dd4850f5bef607c3065db3c1231;hb=dfc4fb72649668ce8f919eb947102cab3f5af607;hp=153f61d25900c052159b135fd403e5f9cc911d27;hpb=0f258b3509c2d5c097e3ca051f8e9b233cb5cd0d;p=grml-etc-core.git diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 153f61d..24e979b 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -974,18 +974,16 @@ If you want to use xinit anyway please call \"/usr/bin/xinit\"." } compdef _functions reload freload - # list symlinks in detail (more detailed version of 'readlinkg -f') + # list symlinks in detail (more detailed version of 'readlink -f' and 'whence -s') sll() { - if [ -z "$1" ] ; then - print 'Usage: sll ' >&2 - return 1 - fi - for i in $* ; do - ls --color=auto -la "$i" - if [ -L "$i" ] ; then - sll $(readlink "$i") - fi - done + [ -z "$1" ] && printf 'usage: %s \n' "$0" && exit 1 + for i in "$@" ; do + file=$i + while [ -h "$file" ] ; do + ls -l $file + file=$(readlink "$file") + done + done } # fast manual access