[96800] in RedHat Linux List
Re: Scripting
daemon@ATHENA.MIT.EDU (Thomas Ribbrock \(Design/DEG\))
Thu Oct 29 12:28:32 1998
Date: Thu, 29 Oct 1998 17:00:24 +0000
From: "Thomas Ribbrock \(Design/DEG\)" <argathin@iname.com>
To: RedHat List <redhat-list@redhat.com>
Mail-Followup-To: RedHat List <redhat-list@redhat.com>
In-Reply-To: <Pine.LNX.3.96.981029112540.3134A-100000@linuxtest.fellows.denison.edu>; from Linux User on Thu, Oct 29, 1998 at 11:30:09AM -0500
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com
Linux User writes:
>
> How do I store a output to a variable,
>
> what I want to do is to get the output of
>
> $ grep alive /usr/local/bin/fpinger/rundata
>
> to a variable ($pingalive) so i can do
>
> $ mail -s $pingalive whoever@whereever.xyz
> (basically get the result of fping in the subject line)
Backticks are your friend here. In sh syntax:
pingalive=`grep alive /usr/local/bin/fpinger/rundata`
HTH,
Thomas
--
"Look, ma, no obsolete quotes!"
Thomas Ribbrock | http://www.bigfoot.com/~kaytan | ICQ#: 15839919
"You have to live on the edge of reality - to make your dreams come true!"
--
PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com http://archive.redhat.com
To unsubscribe: mail redhat-list-request@redhat.com with
"unsubscribe" as the Subject.