Peter Lemus wrote:
> 
> Hi, I'm getting a syntax error on the following
> command
> 
> $PIDS=`ps -ef | grep $user | grep -v grep | cut -b
> 10-14`
> 
> Please help.  I need to get the process id of $user
> and assign it to PIDS, then kill it.

This little script worked on my system to prind out the PIDS.  But like
Peter Cornelius said, we can't really help address the error if we don't
know the error.

#!/usr/local/bin/perl -w

use strict;

my $user = 'dan';

chomp( my @PIDS = `ps -ef | grep $user | grep -v grep | cut -b 10-14` )

foreach( @PIDS ) {
   print "[$_]\n";
}

Reply via email to