[NTLUG:Discuss] Broken links

MadHat madhat at unspecific.com
Wed Dec 4 09:55:08 CST 2002


On Wed, 2002-12-04 at 09:13, jeremyb at univista.com wrote:
>  I just ran the initial find portion of this command and all it returned was
> broken links.
> I don't see this list in the man page as a behavior.  Shouldn't it return
> all links?
> 

Its not actually a feature, but an error you are seeing, and the grep
|... you sent in earlier will not work unless you redirect STDERR to
STDOUT.

The -print is useless in this case.

-follow says to follow the link
-type l says to only show links
-print would only print if both return true which will never happen (but
might cause a loop).  All you get is the STDERR message when it tries to
follow the link that it can't find where it is pointed to.

> -J
> 
> -----Original Message-----
> From: jeremyb at univista.com
> To: rusty at fe2o3.lonestar.org; discuss at ntlug.org
> Sent: 12/4/02 8:30 AM
> Subject: RE: [NTLUG:Discuss] Broken links
> 
>  If you wanted to pull out only broken ones and act on those you could
> add
> this to the end.
> 
> | grep "No such file" | awk '{print $2}' | xargs <your command that acts
> on
> broken ones>
> 
> 
> -J
> 
> -----Original Message-----
> From: Rusty Haddock
> To: discuss at ntlug.org
> Sent: 12/4/02 12:43 AM
> Subject: Re: [NTLUG:Discuss] Broken links
> 
> Greg Edwards wrote:
>     >Anyone remember the command to chase down broken symbolic links?
> 
> The command below appears to work for me:   Some of the following
> links are directories while others are "plain" files.  Options of
> -xtype or -type may be of some additional use.
> 
> [289] -=> find ~ -type l -follow -print
> find: /home/rusty/Html/Tcl: No such file or directory
> find: /home/rusty/Html/Java: No such file or directory
> find: /home/rusty/Hardware/NewMicros/SMALLC/bar: No such file or
> directory
> find: /home/rusty/Hardware/NewMicros/baz: No such file or directory
> find: /home/rusty/Mail.old/arcie: No such file or directory
> 
> 	-Rusty-
-- 
MadHat at Unspecific.com
`But I don't want to go among mad people,' Alice remarked.
`Oh, you can't help that,' said the Cat: `we're all mad here...'
   -- Lewis Carroll - _Alice's_Adventures_in_Wonderland_




More information about the Discuss mailing list