I'm very curious why you want this. Anyway, basically, go to the top
level and run this perl script( NOTE - I haven't even tested this to see
if it will compile, so it will likely delete all your files and set your
computer on fire. But it should give you a starting point):
#!/usr/bin/perl
sub runsub
{
my $curdir = shift;
open(TMPFH, "theform.html");
$tmprs = $/;
undef $/;
$data = <TMPFH>;
close(TMPFH);
$/ = $tmprs;
$data =~
s/action="myscript.pl"/action="http://www.thesite.com${curdir}myscript.pl"/g;
open(TMPFH, ">theform.html");
print TMPFH $data;
close(TMPFH);
}
sub runme
{
my $curdir = shift;
runsub($curdir);
my @dirs;
opendir(DIRFH, ".");
while($dirname = readdir(DIRFH))
{
if( -d $dirname)
{
push(@dirs, $dirname);
}
}
close(DIRFH);
foreach my $dir (@dirs)
{
chdir($dir);
runme("${curdir}${dir}/");
chdir("..");
}
}
runme("/");
On Mon, 23 Jun 2003, Richard Crawford wrote:
> I have an urgent need inside a shell script to replace a filename within
> an html file with the absolute url to the file.
>
> For example, http://www.thesite.com/theform.html calls a CGI script. The
> FORM tag looks like this:
>
> < form name="thisForm" method="post" action="myScript.pl" >
>
> What I need to do is create a shell script that will replace
>
> action="myScript.pl"
>
> with
>
> action="http://www.thesite.com/myScript.pl"
>
> What's complicating this is that theform.html and myScript.pl are
> replicated in hundreds of directories throughout the site, and
> theform.html in each directory needs to be changed to reflect the local
> copy of myScript.pl.
>
> I hope that wasn't too confusing.
>
> I've been pounding away at it all day and I have come no closer to a
> solution.
>
> Any ideas would be greatly appreciated.
>
>
>
> --
> Sliante,
> Richard S. Crawford
>
> http://www.mossroot.com
> AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford
> MSN: [EMAIL PROTECTED]
>
> "It is only with the heart that we see rightly; what is essential is
> invisible to the eye." --Antoine de Saint Exup�ry
>
>
>
> --
> redhat-list mailing list
> unsubscribe mailto:[EMAIL PROTECTED]
> https://www.redhat.com/mailman/listinfo/redhat-list
>
--
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]
https://www.redhat.com/mailman/listinfo/redhat-list