On 12/18/2013 08:41 AM,
shlo....@gmail.com wrote:
>
> Hi,
>
> I want to run a command something like:
> /cat /tmp/aao | grep aa | wc -l/
> Check the output of that command, if the output is '0', I want to get a
> failure from puppet.
> I tried to use 'exec' with 'returns' but it's seem that 'returns' take
> the return code of the command and not the output of the command.
> How can I do it right?
test $(grep -c aa /tmp/aao) -gt 0
Cheers,
--
Stephen Gran
Senior Systems Integrator -
theguardian.com
Please consider the environment before printing this email.
------------------------------------------------------------------
Visit
theguardian.com
On your mobile, download the Guardian iPhone app
theguardian.com/iphone and our iPad edition
theguardian.com/iPad
Save up to 33% by subscribing to the Guardian and Observer - choose the papers you want and get full digital access.
Visit
subscribe.theguardian.com
This e-mail and all attachments are confidential and may also
be privileged. If you are not the named recipient, please notify
the sender and delete the e-mail and all attachments immediately.
Do not disclose the contents to another person. You may not use
the information for any purpose, or store, or copy, it in any way.
Guardian News & Media Limited is not liable for any computer
viruses or other material transmitted with or as part of this
e-mail. You should employ virus checking software.
Guardian News & Media Limited
A member of Guardian Media Group plc
Registered Office
PO Box 68164
Kings Place
90 York Way
London
N1P 2AP
Registered in England Number 908396
--------------------------------------------------------------------------