I am triggering a UNIX command in Perl script.
I need the process ID of the UNIX command.
For example if i trigger below UNIX command:
# padv -s adv.cfg > adv.out &
[1] 4550
My process ID is 4550.
# ps -ef | grep padv
root 4550 2810 0 16:28 pts/5 00:00:00 padv -s adv.cfg
root 4639 2810 0 16:29 pts/5 00:00:00 grep padv
How to capture that process ID in my Perl Script?
For example, i am triggering my command in Perl script like below:
#!/usr/bin/perl
use strict;
use warnings;
qx(padv -s adv.cfg > adv.out &);