From: Michael Prokop Date: Fri, 13 Apr 2007 15:40:52 +0000 (+0200) Subject: /etc/zsh/zshrc: update function sll X-Git-Tag: 0.2.43~3 X-Git-Url: http://git.grml.org/?p=grml-etc-core.git;a=commitdiff_plain;h=91d0835c1d20d697870290fa97f45b5794d17cf7 /etc/zsh/zshrc: update function sll --- diff --git a/debian/changelog b/debian/changelog index 3ce6b17..696460b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,7 +3,7 @@ grml-etc-core (0.2.43) unstable; urgency=low * /etc/zsh/zshrc: - applied patch by ft for generic file completion (thanks!) - added function sll (list symlinks in more details), thanks - for the code base, Manuel Fuhr! + for the code base, Manuel Fuhr and ft! -- Michael Prokop Fri, 13 Apr 2007 17:35:15 +0200 diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 153f61d..ee18d7c 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