Great Circle Associates Majordomo-Workers
(November 1996)
 

Indexed By Date: [Previous] [Next] Indexed By Thread: [Previous] [Next]

Subject: Re: Load limits
From: Dave Wolfe <dwolfe @ risc . sps . mot . com>
Date: Fri, 22 Nov 1996 09:41:08 -0600 (CST)
To: Brent @ greatcircle . com (Brent Chapman)
Cc: tibbs @ hpc . uh . edu, brozen @ webdreams . com, majordomo-workers @ greatcircle . com
In-reply-to: <v03007800aeba5546ab51@[198.102.244.42]> from "Brent Chapman" at Nov 21, 96 10:58:35 am
Reply-to: Dave Wolfe <david_wolfe @ risc . sps . mot . com>

[ Brent Chapman writes: ]
> 
> Right idea, but not an ideal implementation.  For starters, I'd change the
> "split" line to
> 	@uptime = split(/\s+/);
> in order to make it less sensitive to the exact spacing of the numbers.

JFTR, in describing split the Camel says:

    "If PATTERN is also omitted, the function splits on whitespace,
    /\s+/, after skipping any leading whitespace. [...] As a special
    case, specifying a space (" ") will split on whitespace just as
    split with no arguments does. Thus, split(" ") can be used to
    emulate awk's default behavior, whereas split(/ /) will give you as
    many null initial fields as there are leading spaces."

(As well as null fields for multiple spaces.) So split(" ") and
split(/ /) are *not* equivalent and split(" ") and split(/\s+/) are
nearly equivalent except for leading whitespace, although by referencing
the array relative to the tail, the distinction is moot in this case.

It should also be noted in the patch that not every uptime(1)
implementation displays load averages, which is required for the code to
work.

-- 
 Dave Wolfe


Follow-Ups:
References:
Indexed By Date Previous: request for information
From: Rick Mooney <rmooney@tenet.edu>
Next: Re: Umask not set in 1.94
From: Chan Wilson <cwilson@slurp.neu.sgi.com>
Indexed By Thread Previous: Re: Load limits
From: Jason L Tibbitts III <tibbs@hpc.uh.edu>
Next: Coding style
From: Brent Chapman <Brent@GreatCircle.COM>

Google
 
Search Internet Search www.greatcircle.com