Re: [SLUG] links

From: James Forte (james@magna.net)
Date: Sat May 17 2008 - 08:58:01 EDT


Build a simple shell script. That's what linux is all about.

iterate over each file that 'find -type l' finds and check it with any
command that opens a file... like the 'file' command.

Every broken link will have a different error message.

for F in `find /james/username -type -l`
do
         RES=`file $F`
         if [ echo $RES | grep broken ]
         then
                 echo $RES
         fi
done

Yours Truly
James Forte, Magna Timeshare Software
http://www.magna.net/ mailto:James@Magna.Net
-----------------------------------------------------------------

On Fri, 16 May 2008, Eben King wrote:

> No, not the browser.
>
> I can find all links by "find -type l ...". Fair enough, I can look for the
> the red ones in "ls". I might miss one, though, so how do I find only broken
> links?
>
> While we're at it, is there any means to maintain (or fix) cross-device links
> so they'll work even if I move or rename the target?
>
> --
> -eben QebWenE01R@vTerYizUonI.nOetP http://royalty.mine.nu:81
> ARIES: The look on your face will be priceless when you find that 40lb
> watermelon in your colon. Trade toothbrushes with an albino dwarf, then
> give a hickey to Meryl Streep. -- Weird Al, _Your Horoscope for Today_
> -----------------------------------------------------------------------
> This list is provided as an unmoderated internet service by Networked
> Knowledge Systems (NKS). Views and opinions expressed in messages
> posted are those of the author and do not necessarily reflect the
> official policy or position of NKS or any of its employees.
>
-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS). Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 15:50:47 EDT