zsh-users
 help / color / mirror / code / Atom feed
From: Peter Williams <williams@eisws25.jpl.nasa.gov>
To: ZShell Users <zsh-users@math.gatech.edu>
Subject: Re: finding symlinks without target
Date: Fri, 23 Jan 1998 08:47:36 -0800	[thread overview]
Message-ID: <199801231647.IAA01963@eisws25.jpl.nasa.gov> (raw)
In-Reply-To: Your message of "Fri, 23 Jan 1998 08:00:23 PST." <980123080024.ZM16631@candle.brasslantern.com>

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 <peter.williams@jpl.nasa.gov>

------------------ 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"


  parent reply	other threads:[~1998-01-23 17:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-01-23 14:47 Sven Guckes
1998-01-23 15:12 ` Bernd Eggink
1998-01-23 15:26 ` Bruce Stephens
1998-01-23 16:00 ` Bart Schaefer
1998-01-23 16:42   ` Bruce Stephens
1998-01-23 17:10     ` zsh manual - more examples! Sven Guckes
1998-01-23 16:47   ` Peter Williams [this message]
1998-01-23 17:51 ` finding symlinks without target Peter Williams
1998-01-23 15:34 Niall Smart
     [not found] <199801231642.IAA27762@shell10.ba.best.com>
1998-01-23 17:10 ` Bart Schaefer
1998-01-23 17:46   ` Bruce Stephens
1998-01-26  4:41 Paul Lew

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199801231647.IAA01963@eisws25.jpl.nasa.gov \
    --to=williams@eisws25.jpl.nasa.gov \
    --cc=zsh-users@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).