namazu-users-en
[Top] [All Lists]

Repost: .namazurc

2002-08-28 02:24:24
I didnt get a response to this issue, is this a bug, feature of the
software? Am  I asking it to do something it was not designed to do ?

Mark

Mark Hatton said:
Makoto Fujiwara

Thank you for your help.
It almost works.

2 issues:-

1/  I am still getting %20's in the path and filenames, and instead of
getting the windows directory sepearator \ I am now getting %5C.

2/ For some reason namazu.cgi seems to be prefixing its http cgi path to
the search results ie:-

http://web.server.com/cgi/%5C%5Csserver%5Cgeneral%5Caugust%20accounts.xls

Thanks

Mark

Makoto Fujiwara said:

Mark> need something to allow the the unix directory seperator / to be
Mark> translated into a windows seperator \ and %20 replaced to a
single space, Mark> for an undefined path size and any number of
%20's.

How about
--replace='s|/export/samba_docs|//server|;s|/|\\|g;s|%(\d{2})|pack("H2",$1)|ge;s|
 | |g;'; ?
(Some shell escape issue may still be there, sorry)

I will attach my practice to get above line:

#!/usr/pkg/bin/perl
my $in = '/export/samba_docs/general/august%20accounts.xls';
                 ##  \\sserver\general\august accounts.xls

$in =~ s|/export/samba_docs|//server|;
print $in,"\n";
$in =~ s|/|\\|g;
print $in,"\n";
$in =~ s|%(\d{2})|pack("H2",$1)|ge;
print $in,"\n";
$in =~ s|  | |g;

__END__

--replace='s|/export/samba_docs|//server|;s|/|\\|g;s|%(\d{2})|pack("H2",$1)|ge;s|
 | |g;';

---
Makoto Fujiwara,


--
Mark Hatton
Systems Administrator
Community Online


-- 
Mark Hatton
Systems Administrator
Community Online



<Prev in Thread] Current Thread [Next in Thread>