* /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 <mika@grml.org> Fri, 13 Apr 2007 17:35:15 +0200
}
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 <file>' >&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 <file>\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