Thursday, December 20, 2001, 4:02:00 AM, KeN ClarK wrote:

> right now i do 

> w | head -1

> and get what's below my signature. I want to clean that up, cutting it 
> after the # of users, so that everything after AND including the third 
> comma is removed from that line. Then take that and add it to my signature 
> script. i can either send it to a new file and cat that into the signature 
> script, or figure out a way to write my script over in perl. right now 
> it's just a simple bash thing of 4 lines. my question is how can i read 
> the output of w | head -1 into a file, and then remove all after the 3rd 
> comma, to include the comma, and have that saved in a file?

> if there's a better way to do this, please advise. (after ghosting on this 
> list for awhile, I see how there's alot of ways to do anything...) also, 
> i'd like more or less pointers so i can kludge through this one myself.

i see you got lots of answers, but in the spirit of
TMTOWTDI, seeing as you say you're on a linux box you might
want to look at the file /proc/loadavg, which has the load
information in there.

also if you've got a copy of the cookbook around have a look
at recipe 16.22 which has some interesting stuff about using
named pipes for .sig files. named pipes are good for .sig
files...


-- 
Best Regards,
Daniel                                  [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to