Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: symlink chain.
- X-seq: zsh-users 19658
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: symlink chain.
- Date: Fri, 2 Jan 2015 17:03:07 +0000
- In-reply-to: <549E3A7B.9010209@eastlink.ca>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <549E3A7B.9010209@eastlink.ca>
On Fri, 26 Dec 2014 20:50:03 -0800
Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
> I just noticed that 'whence -s' very quietly 'finishes' a chain of
> links, and shows you the final target. 'ls' OTOH only ever shows you
> the first link in a chain. It gets me wanting some way of showing an
> entire chain of links where that applies. Can it be done?
showlinkchain () {
zmodload -F zsh/stat b:zstat
local args
while [[ -h $1 ]]
do
zstat -A args +link $1
if [[ -n $args[1] ]]
then
print -r - $args[1]
set -- $args[1]
else
break
fi
done
}
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author