#!/usr/bin/perl # findpids use strict; use warnings; use Unix::PID; use Getopt::Long; my $cmd = ''; GetOptions( 'command=s' => \$cmd, ); my $pobj = Unix::PID->new; print join(' ',$pobj->get_pidof($cmd)),"\n";