mirror of
https://github.com/Cacti/cacti.git
synced 2026-11-08 21:16:17 +09:00
git-svn-id: svn+ssh://repo.cacti.net/var/data/svnroot/cacti/branches/BRANCH_0_8_6/cacti@3439 860744bd-22fc-0310-8c96-e9fe5004b5ca
16 lines
264 B
Perl
16 lines
264 B
Perl
#!/usr/bin/perl
|
|
|
|
my $grep_string = $ARGV[0];
|
|
|
|
chomp $grep_string;
|
|
|
|
if ($grep_string eq '') {
|
|
open(PROCESS, "who | grep -c : |");
|
|
}else{
|
|
open(PROCESS, "who | grep : | grep -c $grep_string |");
|
|
}
|
|
$output = <PROCESS>;
|
|
close(PROCESS);
|
|
chomp($output);
|
|
print $output;
|