⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 myrup

📁 早期freebsd实现
💻
字号:
#!/usr/bin/perl# $Header: myrup,v 4.0 91/03/20 01:11:16 lwall Locked $# This was a customization of ruptime requested by someone here who wanted# to be able to find the least loaded machine easily.  It uses the# /etc/ghosts file that's defined for gsh and gcp to prune down the# number of entries to those hosts we have administrative control over.print "node    load (u)\n------- --------\n";open(ghosts,'/etc/ghosts') || die "Can't open /etc/ghosts: $!";line: while (<ghosts>) {    next line if /^#/;    next line if /^$/;    next line if /=/;    ($host) = split;    $wanted{$host} = 1;}open(ruptime,'ruptime|') || die "Can't run ruptime: $!";open(sort,'|sort +1n');while (<ruptime>) {    ($host,$upness,$foo,$users,$foo,$foo,$load) = split(/[\s,]+/);    if ($wanted{$host} && $upness eq 'up') {	printf sort "%s\t%s (%d)\n", $host, $load, $users;    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -