From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 889 invoked from network); 23 Jan 1998 17:08:07 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 23 Jan 1998 17:08:07 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id LAA04126; Fri, 23 Jan 1998 11:46:26 -0500 (EST) Resent-Date: Fri, 23 Jan 1998 11:46:09 -0500 (EST) Message-Id: <199801231647.IAA01963@eisws25.jpl.nasa.gov> X-Authentication-Warning: eisws25.jpl.nasa.gov: williams@localhost didn't use HELO protocol To: ZShell Users Subject: Re: finding symlinks without target In-reply-to: Your message of "Fri, 23 Jan 1998 08:00:23 PST." <980123080024.ZM16631@candle.brasslantern.com> Date: Fri, 23 Jan 1998 08:47:36 -0800 From: Peter Williams Resent-Message-ID: <"58ztQ1.0.k_.HbCoq"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1261 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu In message <980123080024.ZM16631@candle.brasslantern.com>, "Bart Schaefer" writ es: > file **/*(D@) | fgrep broken > >(You may need to change the grep if you're not using GNU `file`.) > >Oh, you want it all in zsh? > > for i in **/*(D@); [[ -f $i || -d $i ]] || echo $i > >But I think the pipe to fgrep would be faster. (Why isn't there a glob >qualifier to chase links? **/*(@^.,@^/) would appear to be perfect, but >doesn't work.) You could also implement it as a function with perl: badsyms () { perl -e '{ require "find.pl"; sub wanted { !stat($_) && print("$name\n") } &find(@ARGV); }' $* } However, this seems a bit slower than M. Schaefer's solutions above. Peter Williams ------------------ SITUATION: New Account Creation ------------------- ADMINISTRATIVE FASCIST: Puts new account policy in motd. Since people without accounts cannot read the motd, nobody ever fulfills the bureaucratic requirements; and so, no new accounts are ever created. -- Stephan Zielinski, "KNOW YOUR UNIX SYSTEM ADMINISTRATOR"