/[cvs]/nfo/perl/libs/shortcuts.pm
ViewVC logotype

Diff of /nfo/perl/libs/shortcuts.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.15 by jonen, Tue Jun 24 20:21:12 2003 UTC revision 1.16 by joko, Wed Jun 25 22:49:56 2003 UTC
# Line 2  Line 2 
2  ##  $Id$  ##  $Id$
3  ## ---------------------------------------------------------------------------  ## ---------------------------------------------------------------------------
4  ##  $Log$  ##  $Log$
5    ##  Revision 1.16  2003/06/25 22:49:56  joko
6    ##  RUNNING_IN_HELL mode for detach option
7    ##
8  ##  Revision 1.15  2003/06/24 20:21:12  jonen  ##  Revision 1.15  2003/06/24 20:21:12  jonen
9  ##  + changed linux part of run_cmd to use Proc::Background instead of IPC::...  ##  + changed linux part of run_cmd to use Proc::Background instead of IPC::...
10  ##  ##
# Line 212  sub run_cmd { Line 215  sub run_cmd {
215      $cmd = "$application$cmd" if $application;      $cmd = "$application$cmd" if $application;
216    #}    #}
217    
218      my @cmd = split(' ', $cmd);
219    
220    # V3 - using IPC (optional)    # V3 - using IPC (optional)
221    if ($options->{async}) {    if ($options->{async}) {
222    
223      #run \@cmd, \$in, \$out, \$err, timeout( 10 ) or die "cat: $?";      #run \@cmd, \$in, \$out, \$err, timeout( 10 ) or die "cat: $?";
224      my @cmd = split(' ', $cmd);  
225            print STDOUT "run_cmd[async]: Proc::Background: $cmd", "\n";
226            
227      # V3.1 - using IPC::Run      # V3.1 - using IPC::Run
228      #      #
# Line 226  sub run_cmd { Line 231  sub run_cmd {
231      if (RUNNING_IN_HELL()) {      if (RUNNING_IN_HELL()) {
232            
233        #my $in; my $out; my $err;        #my $in; my $out; my $err;
       print STDOUT "run_cmd: IPC::Run: $cmd", "\n";  
234                
235        #print STDOUT "findpath: ", findpath('rap.pl'), "\n";        #print STDOUT "findpath: ", findpath('rap.pl'), "\n";
236                
# Line 318  sub run_cmd { Line 322  sub run_cmd {
322    
323    
324    } elsif ($options->{detach}) {    } elsif ($options->{detach}) {
325      print STDERR "run_cmd: system('$cmd' &).", "\n";  
326      system($cmd . ' &');          if (RUNNING_IN_HELL()) {
327          print STDOUT "run_cmd[detach]: Proc::Background: $cmd", "\n";
328          my $proc1 = Proc::Background->new(@cmd);
329          print "pid: ", $proc1->pid(), "\n";
330        } else {
331          print STDERR "run_cmd[detach]: system('$cmd' &).", "\n";
332          system($cmd . ' &');    
333        }
334    
335    } else {    } else {
336      print STDOUT "run_cmd: system('$cmd').", "\n";      print STDOUT "run_cmd: system('$cmd').", "\n";

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed