Android中Parcelable的感化實例解析。本站提示廣大學習愛好者:(Android中Parcelable的感化實例解析)文章只能為提供參考,不一定能成為您想要的結果。以下是Android中Parcelable的感化實例解析正文
重要是應用查找/proc目次下的相干文件停止查找.
#!/usr/bin/perl
use strict;
use warnings;
#usage: process_grep.pl ProcessName
exit( main(@ARGV) );
sub main {
my $Phash;
my $ProcessName = shift;
my $PROC_DIR = "/proc";
chdir $PROC_DIR;
my @pids = glob "[0-9]*";
for my $pid (@pids) {
open( FH, "$pid/cmdline" ) or die "Can't $pid file $!";
$Phash->{$pid} = $_ while <FH>;
}
delete $Phash->{"$$"};
for my $pid ( keys %$Phash ) {
print $pid, "\n" if $Phash->{$pid} =~ /$ProcessName/;
}
return 0;
}