[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: set command overrides my ARGV array
From: |
Eric Blake |
Subject: |
Re: set command overrides my ARGV array |
Date: |
Tue, 27 Dec 2016 14:31:19 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 |
On 12/27/2016 10:21 AM, Martin MOKREJŠ wrote:
> Hi,
> I wanted to enable error code reporting for piped processes. This
> should be doable by "set -o pipeline on". The problem is it kills my $*
> array and defines $1="on".
That's because you used the wrong syntax.
'set -o pipefail' turns it on,
'set +o pipefail' turns it off
'set -o pipefail on' is the same as 'set -o pipefail; set on', which
turns it on but also changes $*.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature