#!/usr/bin/perl -w # 1999-06, 2000-11 # http://www.cyut.edu.tw/~ckhung/b/mi/ # usage: sysinfo [row [col]] # Note: the screen must support ANSI escape sequences # (Best left running in the background.) $E = "\x1b"; $r = $#ARGV >= 0 ? $ARGV[0] : 1; $r1 = $r + 1; $c = $#ARGV >= 1 ? $ARGV[1] : 68; $| = 1; while (1) { @t = localtime(time); opendir P, "/proc"; @p = grep { /^\d+$/ } readdir(P); closedir P; print "${E}7${E}[7m"; printf "${E}[${r};${c}H%02d:%02d:%02d${E}[K", @t[2,1,0]; printf "${E}[${r1};${c}H%4d${E}[K", $#p+1; print "${E}[m${E}8"; sleep 1; }