0 Replies - 18683 Views - Last Post: 24 December 2012 - 05:54 PM

#1 Hollywood0728   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 21-September 09

Cant figure out how to dump processes into an array after pgrep

Posted 24 December 2012 - 05:54 PM

This is part of a menu driven script I am trying to wrap up and im stuck.

I am using pgrep to get all the processes associated to a user, that works. Now I need to dump those into an array so I can kill all at the same time rather than one by one. I included a global variable called

my @processes = 'ls -l';

But I know there is more.

case 5 {print "Please enter the username for all associated processes \n" ;
chomp ($user_input = <>) ;
system("pgrep -l $user_input");

Is This A Good Question/Topic? 0
  • +

Page 1 of 1