SCIENTIFIC-LINUX-DEVEL Archives

November 2013

SCIENTIFIC-LINUX-DEVEL@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Elias Persson <[log in to unmask]>
Reply To:
Elias Persson <[log in to unmask]>
Date:
Tue, 19 Nov 2013 07:14:53 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (18 lines)
On 2013-11-18 21:38, Paul Robert Marino wrote:
> well if you want that then you need to create a bash script for cron to execute
> in the script you put the output of the yum command to a variable via
> a back tick and then you use an if statement to check the results of
> $? to determine whether to echo the contents of the variable to
> standard out triggering cron to send an email, or to unset the
> variable and exit.
>

That seems to work.

   output="$(yum --disablerepo='*' install kedddrnel 2>&1)"
   echo "RC: $?"
   echo "Output:"
   echo "$output"

(at least in bash)

ATOM RSS1 RSS2