The calculation is really very simple:

n / p * k

where:
The "raw" number of keys pressed = k
The number of processes invoked with the command = n
The utility of the command, where 0 is useless and 1 is useful = p

Therefore we see that "w" quickly approaches an infinite number of
keystrokes (even though the raw keys pressed is only 1), as the utility of
the output approaches 0.  I estimate the utility value to be approximately
.01, or 1% useful (that is 99% of the output is useless, based on
character-columns over lines cubed).

The calculation for the "w" command is as follows:
1 / 1 * .01 = 100 keystrokes

Whereas:

w|head -1|awk '{print $3}'  is:

3 / 1 * 25 = .12 keystrokes

This is because there are 25 necessary raw keypresses, 3 processes
invoked, and the utility is 1 or 100% useful, because we only get the
output absolutely necessary for what we're doing.

Note that you can also modify the equation to use Ll (LoveLaces) as the
utility value, p.  LoveLaces are the less accurate measure of how much
certain software sucks.  Lovelace's theorem is that all software sucks to
some degree.  Solaris sucks a couple uLl, HP BrokenView sucks 5 or
6 mLl, whereas your average Microsoft software is in the order of 10 or 20 Ll.

Adam Maloney
Systems Administrator
Sihope Communications

On Wed, 22 Nov 2000 andy at theasis.com wrote:

> 
> > w | head -1 | awk '{ print $3 }' 
> > 
> > is less keystrokes than "uptime" :)
> > 
> 
> Oh, I didn't mention that real geeks have a somewhat different geometric
> space in which they perform keystroke counting. 
> 
> Andy
> 
> > Adam Maloney
> > Systems Administrator
> > Sihope Communications
> > 
> > On Wed, 22 Nov 2000 andy at theasis.com wrote:
> > 
> > > > of course everyone is going to say uptime, but real geeks cat /proc/uptime
> > > > ;)
> > > 
> > > No, I think the *real* geek would think of that, but opt for the solution
> > > with fewer keystrokes. Geek would instead go for the letter "w". But
> > > perhaps the excessive output would be deemed undesirable, and so the
> > > ultimate result would be along the lines of creating "alias u = 'uptime'".
> > > This has the added advantage of customizing one's personal environment so
> > > that it's more obscure to the layman. 
> > > 
> > > Andy
> > > 
> > > > Thank You,
> > > >         Ben Kochie (ben at nerp.net)
> > > 
> > > _______________________________________________
> > > tclug-list mailing list
> > > tclug-list at lists.real-time.com
> > > https://mailman.real-time.com/mailman/listinfo/tclug-list
> > > 
> > 
> > _______________________________________________
> > tclug-list mailing list
> > tclug-list at lists.real-time.com
> > https://mailman.real-time.com/mailman/listinfo/tclug-list
> > 
> 
> 
> _______________________________________________
> tclug-list mailing list
> tclug-list at lists.real-time.com
> https://mailman.real-time.com/mailman/listinfo/tclug-list
>