Help for this page

Select Code to Download


  1. or download this
    open(PS, "ps -ef |") or die "Problem invoking 'ps': $!\n";
    while (<PS>) {
    ...
      print "pid $pid\n";
    }
    close(PS);
    
  2. or download this
    while (<PS>) {
      next unless /$version/ && /online/;
      ($pid) = (split)[2];
    }
    print "pid $pid\n";