On Dec 30, 2003, at 3:54 PM, deb wrote:
Happy Almost New Year![..]
It seems to be only going as far as dropping off the grep, and not doing the
awk '{print $2}'. I've tried this with the system() call, with the same
results.
What am I missing? :-(
you have a shell interpret who to which problem.
vladimir: 65:] perl junk.plx $pid is: 192
vladimir: 66:] sed 's/^/### /' junk.plx
### #!/usr/bin/perl -w
### use strict;
###
### my $cmd = q!ps -ef | egrep '[/]usr/lib/sendmail' | awk '{print $2}' !;
###
### my $pid = `$cmd`;
### print "\$pid is: $pid \n";
###
###
vladimir: 67:]
Andrew's suggestion of guarding the "$2" will also work. I thought I would base my variant on Luke's somewhat tighter general solution.
ciao drieux
---
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>