Re: extract uptime for linux box w/perl

2001-12-20 Thread Daniel Gardner
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

Re: extract uptime for linux box w/perl

2001-12-20 Thread Jim Conner
At 08:28 12.20.2001 -0500, Kevin Meltzer wrote: >Am I just the overly paranoid one? But IMO doing this can be dangerous. >Tainting isn't just for CGIs, and adding a -T to this shows it can be >dangerous ($ENV{PATH} issue, since you don't really know what uptime you will >end up calling). Again, I

Re: extract uptime for linux box w/perl

2001-12-20 Thread Jim Conner
At 11:06 12.20.2001 +0200, Stef wrote: >Damn if you're gonna do it this way , why not just do: >uptime > >Thus spake John W. Krahn on 20-Dec-2001 : >-> perl -le'print join",",(split/,/,`uptime`)[0..2]' I love Perl :") - Jim >~~~ >E-Mail: Stef <[EMAIL PROTECTE

Re: extract uptime for linux box w/perl

2001-12-20 Thread Kevin Meltzer
Am I just the overly paranoid one? But IMO doing this can be dangerous. Tainting isn't just for CGIs, and adding a -T to this shows it can be dangerous ($ENV{PATH} issue, since you don't really know what uptime you will end up calling). Again, I may be the overly-paranoid (read safe) one :) Cheer

RE: extract uptime for linux box w/perl

2001-12-20 Thread Steven Hetland
> -Original Message- > > 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 > scrip

Re: extract uptime for linux box w/perl

2001-12-20 Thread Stef
Damn if you're gonna do it this way , why not just do: uptime Thus spake John W. Krahn on 20-Dec-2001 : -> perl -le'print join",",(split/,/,`uptime`)[0..2]' ~~~ E-Mail: Stef <[EMAIL PROTECTED]> Date:20-Dec-2001 Time:11:05:43 XFMail

Re: extract uptime for linux box w/perl

2001-12-20 Thread John W. Krahn
Jim Conner wrote: > > At 02:01 12.20.2001 -0500, Jim Conner wrote: > > > >At 00:26 12.20.2001 -0500, Steven Hetland wrote: > > > > > >There's probably a bazillion ways to accomplish this, but here's two ways: > > > > > >Example 1: > > >-- > > >chomp($uptime = `uptime`); > > >$uptime =~ s/

RE: extract uptime for linux box w/perl

2001-12-19 Thread Jim Conner
At 02:01 12.20.2001 -0500, Jim Conner wrote: >-BEGIN PGP SIGNED MESSAGE- >Hash: SHA1 > >At 00:26 12.20.2001 -0500, Steven Hetland wrote: > > > -Original Message- > > > > > > right now i do > > > > > > w | head -1 > > > > > > and get what's below my signature. I want to clean that

RE: extract uptime for linux box w/perl

2001-12-19 Thread Jim Conner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 At 00:26 12.20.2001 -0500, Steven Hetland wrote: > > -Original Message- > > > > 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 aft

Re: extract uptime for linux box w/perl

2001-12-19 Thread Jim Conner
At 23:02 12.19.2001 -0500, 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 >