68
|
0 |
0 |
1 |
eval {
do {
die unless open my $fh, '<', 'File::Spec'->catfile('', 'proc', getppid, 'comm');
my $command_line = readline $fh;
die unless defined $command_line;
close $fh;
$command_line =~ s/\0.*$//;
_unixy_shells($command_line)
}
} || eval {
do {
die unless open my $fh, '<', 'File::Spec'->catfile('', 'proc', getppid, 'cmdline');
my $command_line = readline $fh;
die unless defined $command_line;
close $fh;
$command_line =~ s/\0.*$//;
_unixy_shells($command_line)
}
} || eval {
do {
require Unix::Process;
my $method = $^O eq 'solaris' ? 'comm' : 'command';
my($command) = map({s/\s+.*$//;
$_;} 'Unix::Process'->$method(getppid));
_unixy_shells($command)
}
} |