#!/bin/csh
# Improved version of Unix "uptime" command.
# (But it's about 38 times slower at 3 1/2 seconds!)

set main = `uptime`
set u2dir = `dirname $0`
set users = `$u2dir/users2`
set users = $#users
@ c = 1 
foreach a ( $main )
  if ( $a == "average:" ) then
    @ c++
    set load = $main[$c]
    @ c--
  endif
  @ c++
end

set w = `echo $load|sed 's/\.//'|sed 's/,//'`

@ w/= $users
@ a = $w / 100
@ b = $w - ( $a * 100 )

if ( $b < 10 ) set b = "0$b"

@ f = ( $w + 10 ) / 20

echo "Users: $users, Load: $load Load/User: $a.$b, Strain factor: $f"
