/[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.17 by jonen, Wed Jul 2 11:17:32 2003 UTC
# Line 2  Line 2 
2  ##  $Id$  ##  $Id$
3  ## ---------------------------------------------------------------------------  ## ---------------------------------------------------------------------------
4  ##  $Log$  ##  $Log$
5    ##  Revision 1.17  2003/07/02 11:17:32  jonen
6    ##  minor changes
7    ##
8    ##  Revision 1.16  2003/06/25 22:49:56  joko
9    ##  RUNNING_IN_HELL mode for detach option
10    ##
11  ##  Revision 1.15  2003/06/24 20:21:12  jonen  ##  Revision 1.15  2003/06/24 20:21:12  jonen
12  ##  + 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::...
13  ##  ##
# Line 212  sub run_cmd { Line 218  sub run_cmd {
218      $cmd = "$application$cmd" if $application;      $cmd = "$application$cmd" if $application;
219    #}    #}
220    
221      my @cmd = split(' ', $cmd);
222    
223    # V3 - using IPC (optional)    # V3 - using IPC (optional)
224    if ($options->{async}) {    if ($options->{async}) {
225    
226      #run \@cmd, \$in, \$out, \$err, timeout( 10 ) or die "cat: $?";      #run \@cmd, \$in, \$out, \$err, timeout( 10 ) or die "cat: $?";
227      my @cmd = split(' ', $cmd);  
228            print STDOUT "run_cmd[async]: Proc::Background: $cmd", "\n";
229            
230      # V3.1 - using IPC::Run      # V3.1 - using IPC::Run
231      #      #
# Line 226  sub run_cmd { Line 234  sub run_cmd {
234      if (RUNNING_IN_HELL()) {      if (RUNNING_IN_HELL()) {
235            
236        #my $in; my $out; my $err;        #my $in; my $out; my $err;
       print STDOUT "run_cmd: IPC::Run: $cmd", "\n";  
237                
238        #print STDOUT "findpath: ", findpath('rap.pl'), "\n";        #print STDOUT "findpath: ", findpath('rap.pl'), "\n";
239                
# Line 318  sub run_cmd { Line 325  sub run_cmd {
325    
326    
327    } elsif ($options->{detach}) {    } elsif ($options->{detach}) {
328      print STDERR "run_cmd: system('$cmd' &).", "\n";  
329      system($cmd . ' &');          if (RUNNING_IN_HELL()) {
330          print STDOUT "run_cmd[detach]: Proc::Background: $cmd", "\n";
331          my $proc1 = Proc::Background->new(@cmd);
332          print "pid: ", $proc1->pid(), "\n";
333        } else {
334          print STDOUT "run_cmd[detach]: system('$cmd' &).", "\n";
335          system($cmd . ' &');    
336        }
337    
338    } else {    } else {
339      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.17

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