📄 hostinfo.pl
字号:
#!/usr/bin/perl$who = "/usr/bin/who | wc -l";$ps = "/bin/ps -ef h | wc -l";chomp($numUsers = int( `$who` ));chomp($numProcesses = int( `$ps` ));print "$numUsers\n";print "$numProcesses\n";## The following code prints the system uptime and the hostname. These two# items need to be included in every script that you write and should be the# very last thing that is printed.#chomp($uptime = `/usr/bin/uptime` );print "$uptime\n";chomp($hostname = `/bin/hostname` );print "$hostname\n";
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -