On Fri, Jul 28, 2000 at 12:49:59AM -0400, Darryl Gibson wrote:

> > Current Linux uptime: 3 hours 42 minutes.
> 
> Is that the output of a script in your sig file? How do you do that? I'm
> guessing you run cat on uptime, and export that to variable in your
> script file?

Sorta.  I use perl (this is badly hacked) and use the linux_logo
program since I'm lazy and don't want to parse uptime.  =)  This is
it:

--------------------------------------------------------------------------
#!/usr/bin/perl

$home =  $ENV{"HOME"};

# get current uptime
$uptime = `linux_logo -g -a -F "#U"`;
@uptime = split(/Uptime /,$uptime);
@disp   = split(/minute/,$uptime[1]);
$disp   = "Current Linux uptime: $disp[0]minutes.";

if ($#ARGV lt 0 or $#ARGV gt 1) {
  print "Usage: $^X sigfile\n";
  exit(1);
}

open (SIG, "$ARGV[0]") or die "Can't open $ARGV[0]";
while (<SIG>) {
  $sig .= $_;
}

print "$sig\n\n$disp\n";

#open (SIG,">$home/.sig");
#print SIG "-- \n$sig\n\n$disp";
#close SIG;

exit(0);
--------------------------------------------------------------------------

Like I said, it's pretty ugly.  But it works.

> Can somebody suggest a good tutorial for bash scripts?

Hmmm... Any general Linux book would have some decent bash stuff in
there.  Can't think of a good one off the top of my head.

-- 
[EMAIL PROTECTED], OpenPGP key available on www.keyserver.net
Freezer Burn BBS:  telnet://bbs.freezer-burn.org . ICQ: 54924721
Webmaster for the Linux Portal Site Freezer Burn:  http://www.freezer-burn.org

Current Linux uptime: 11 hours 32 minutes.

Reply via email to