bug-parallel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GNU Parallel Bug Reports env_parallel does not respect exit code from fu


From: Stefan Andres
Subject: GNU Parallel Bug Reports env_parallel does not respect exit code from functions
Date: Wed, 12 Oct 2016 10:59:55 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.4.0

Hi,
the manual states:

EXIT STATUS
       Same as GNU parallel.

But it seems that is not true:

$ parallel --version
GNU parallel 20160922
Copyright (C) 2007,2008,2009,2010,2011,2012,2013,2014,2015,2016

$ myfunc() { exit 1; }
$ . env_parallel.bash
$ set -x
$ parallel myfunc ::: one two; echo $?
+ /usr/local/bin/parallel exit ::: 1 2
[...]
+ unset PARALLEL_ENV
+ echo 0
0

The unset PARALLEL_ENV; line in env_parallel.bash just overwrites the
parallel exit code.

The direct exit code works just fine:

$ parallel exit ::: 1 2; echo $?
2


Regards,
  Stefan

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]