Suppose the call was
/usr/local/bin/perl verify.pl 1 3 de# > result.log
Inside verify.pl
I want to capture the whole call above and append it to a log file for tracking purposes.
How can I capture the whole call as it is?
There is way (at least on unix-systems) to get whole command line:
my $cmdline = `ps -o args -C perl | grep verify.pl`;
print $cmdline, "\n";
e: Cleaner way using PID (courtesy of Nathan Fellman):
print qx/ps -o args $$/;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With