Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Testing for broken symlinks
- X-seq: zsh-users 8719
- From: Paul Lew <paullew@xxxxxxxxx>
- To: Peter Stephenson <pws@xxxxxxx>
- Subject: Re: Testing for broken symlinks
- Date: Wed, 20 Apr 2005 10:20:35 -0700
- Cc: "zsh-users@xxxxxxxxxx" <zsh-users@xxxxxxxxxx>
- In-reply-to: <200504200915.j3K9Fbsi018162@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <opspishpc86k1y1x@aspen> <200504200915.j3K9Fbsi018162@xxxxxxxxxxxxxx>
>>>>> "Peter" == Peter Stephenson <pws@xxxxxxx> writes:
Eric>> Is there any way to test if a symlink is broken?
Peter> This will work:
Peter> broken=(mylinktest(N-@))
Peter> if (( ${#broken} )); then
Peter> print mylinktest is a broken symbolic link
Peter> else
Peter> print mylinktest is not a symbolic link or is not broken
Peter> fi
Peter> <snip>
A off-topic question, what ever happen to the old feature (some
eariler version of zsh) that displays an '&' at end of the bad symlink
when displaying filename completion lists? e.g.,
> touch foo1 foo2
> ln -s not-exist foo3
> ls foo<tab>
foo1@ foo2@ foo3&
Messages sorted by:
Reverse Date,
Date,
Thread,
Author