> #!/usr/bin/perl
>> my ($line,$location) = undef;
>> open(SVERSION, $ENV{'HOME'} . "/.sversionrc") or die "Cannot open
> ~/.sversionrc";
>> while ($line = <SVERSION>)
> {
> if ($line =~ /^OpenOffice.+?file:\/\/(.+?)$/)
> {
> $location = $1;
> }
> }
>> close (SVERSION);
>> print "export EOFFICE=" . $location . "\n";
>> - DoC
Cool, thanks that's really cool and it'll even work for all versions of
OO.
:) I'm a bit of a copy and paste hacker and have expanded the script to
the following:
#!/usr/bin/perl
my ($line,$location) = undef;
open(SVERSION, $ENV{'HOME'} . "/.sversionrc") or die "Cannot open
~/.sversionrc";
while ($line = <SVERSION>)
{
if ($line =~ /^OpenOffice.+?file:\/\/(.+?)$/)
{
$location = $1;
}
}
close (SVERSION);
print "export EOFFICE=" . $location . "\n";
open(SVERSION, $location . "/instdb.ins") or die "Cannot open
instdb.ins";
while ($line = <SVERSION>)
{
if ($line =~ /^SourcePath = \"(.+?)$/)
{
$location2 = $1;
}
}
close (SVERSION);
but when I run it I get
Cannot open instdb.ins at findlocation.pl line 19.
I need to suck a variable out of $location/instdb.ins
but on account of not knowing perl I seem to have bothched
up the open() function
Thanks all
--
Mark Finlay
"sisob's linux eXPerience"
http://sisob.dyndns.org
Registered Linux User: #243436
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!