[Tfug] finding linked pages

Rich r-lists at studiosprocket.com
Fri May 2 20:09:27 MST 2008


It's a find one-liner.

With Gnu find:

find . -iname "*.html" -exec sed -i.bak -e 's/<body>/<body>YOUR  
SCRIPT HERE/' {} \; -print

Remember to escape any sed-special characters, so / becomes \/

With non-Gnu find, -iname is not an option, so you're stuck with case- 
sensitive "-name" instead.

R.


On May 1, 2008, at 1:58 am, Vincent Prime wrote:

> I think your answer would be a bash script that would run through all
> the .html files on the server, and prepend the HTML script for the
> banner directly after the <body> tag.
>
> I am no good at bash scripting, however i suppose someone here can  
> help.
>
> On Thu, May 1, 2008 at 12:15 AM, Robert Hunter <hunter at tfug.org>  
> wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>>  Hash: SHA1
>>
>>
>>  On Wed, Apr 30, 2008 at 11:08:58PM -0700, christopher wrote:
>>> Do you know of a way to find all the linked pages on a
>>> site? Is there such a thing? I'd go through and just do
>>> it for everything on their server, but they have a ton
>>> of old pages that don't get used any more, so I thought
>>> I might be able to skip those. Thanks ~ chris
>>
>>  Discovering the pages is a graph traversal problem.  I wouldn't be
>>  surprised if you could do it with wget, one of the coolest programs
>>  ever.  But this may not be necessary, if you can use server side
>>  includes, where you wrap each page with your banner.
>>  -----BEGIN PGP SIGNATURE-----
>>  Version: GnuPG v1.4.6 (GNU/Linux)
>>
>>  iD8DBQFIGW4jJ1pz6tWxufARAshFAJoCcPgvBNsdPR+8YhdmCz6L8g/ehwCePTfH
>>  gtE3h9gD2EG7QBm6YmmZRsk=
>>  =ChtX
>>  -----END PGP SIGNATURE-----
>>
>>
>>
>>  _______________________________________________
>>  Tucson Free Unix Group - tfug at tfug.org
>>  Subscription Options:
>>  http://www.tfug.org/mailman/listinfo/tfug_tfug.org
>>
>
>
>
> -- 
> From
> - Vincent Prime
>
> _______________________________________________
> Tucson Free Unix Group - tfug at tfug.org
> Subscription Options:
> http://www.tfug.org/mailman/listinfo/tfug_tfug.org





More information about the tfug mailing list