Skip to main content.
home | support | download

Back to List Archive

Re: -Sprog with -N

From: Paul Borghese <pborghese(at)not-real.groupstudy.com>
Date: Wed Sep 25 2002 - 21:20:14 GMT
Ok, here is the base logic I am using.  I will include a snipit of perl
code:

        my @SwishProg;
        my @SwishCmd;
        if(!$force){
            foreach (@reindex) {
                push @SwishProg, "$cfg_arc_dir/$_";
            }
           @SwishCmd = '/home/httpd/cgi-bin/.search/index_gs.pl';
           push @SwishCmd, @SwishProg, '|';
        }
        push @SwishCmd, $cfg_Swishe;
        push @SwishCmd, '-i', 'stdin', '-f', $cfg_IncFile, '-N',
$cfg_IndexFile unless $force;
        push @SwishCmd, '-Sprog', '-c', $SwishConfig, '-e', '-v0';
        @reindex = @archives if $force;
        print "ReIndexing:\n******************\n@SwishCmd\n";
        system @SwishCmd;

So as you can see the program builds the command @SwishCmd the runs a system
on the command. The command before execution looks like this:

/home/httpd/cgi-bin/.search/index_gs.pl /home/httpd/html/archives/200209 |
/usr/local/bin/swish-e -i stdin -f
/home/httpd/html/archives/List.incremental -N
/home/httpd/html/archives/List.index -Sprog  -c
/home/httpd/cgi-bin/.search/list.config -e -v0

Cutting and pasting the above command on the command line works great.  But
If I execute it through the Perl scriptI find the output instead of being
piped into Swish-e gets placed on the screen and the following messages
appear:

Can't stat |: No such file or directory
Can't stat -i: No such file or directory
Can't stat stdin: No such file or directory
Can't stat -f: No such file or directory
Can't stat -N: No such file or directory
Can't stat -Sprog: No such file or directory
Can't stat -c: No such file or directory
Can't stat -e: No such file or directory
Can't stat -v0: No such file or directory

If I do not use the Pipe command but instead perform everything through
swish-e, this problem does not occur and the program works as expected.  If
I was able to change the SwishProgParameters from the swish-e command line,
I would be able to avoid using the pipe command by simply executing swish-e.
It is a problem with Perl not recognizing the pipe in the system command.

It turns out if I change the line system @SwishCmd; to `@SwishCmd`; it will
work.  But it is not my preferred choice.

Take care,

Paul


----- Original Message -----
From: "Bill Moseley" <moseley@hank.org>
To: "Multiple recipients of list" <swish-e@sunsite.berkeley.edu>
Sent: Monday, September 23, 2002 12:34 PM
Subject: [SWISH-E] Re: -Sprog with -N


> At 11:49 AM 09/23/02 -0400, Paul Borghese wrote:
> >I vote to include it.
> >
> >I am trying to write a perl script that automates indexing and can not
> >seem to get my piped perl script to operate through a perl system
> >command call.  I keep on getting the message " No such file or
> >directory" even though it is working fine from the command prompt.
>
> Post the command and I'll take a look (after I get back from the beach
> today...)
>
>
>
> --
> Bill Moseley
> mailto:moseley@hank.org
Received on Wed Sep 25 21:23:48 2002