GNU bug report logs - #23448
stdbuf exit code does not reflect child status

Previous Next

Package: coreutils;

Reported by: "Larry Wilson" <lwilson <at> jlg-tech.com>

Date: Wed, 4 May 2016 15:35:02 UTC

Severity: normal

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 23448 in the body.
You can then email your comments to 23448 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#23448; Package coreutils. (Wed, 04 May 2016 15:35:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Larry Wilson" <lwilson <at> jlg-tech.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Wed, 04 May 2016 15:35:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Larry Wilson" <lwilson <at> jlg-tech.com>
To: <bug-coreutils <at> gnu.org>
Subject: stdbuf exit code does not reflect child status
Date: Wed, 4 May 2016 10:48:25 -0400
[Message part 1 (text/plain, inline)]
How can I get the exit status of the command I am running?

 

 

[Message part 2 (text/html, inline)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#23448; Package coreutils. (Wed, 04 May 2016 15:49:01 GMT) Full text and rfc822 format available.

Message #8 received at 23448 <at> debbugs.gnu.org (full text, mbox):

From: Assaf Gordon <assafgordon <at> gmail.com>
To: Larry Wilson <lwilson <at> jlg-tech.com>, 23448 <at> debbugs.gnu.org
Subject: Re: bug#23448: stdbuf exit code does not reflect child status
Date: Wed, 4 May 2016 11:48:18 -0400
Hello,

On 05/04/2016 10:48 AM, Larry Wilson wrote:
> How can I get the exit status of the command I am running?

I'm not able to reproduce this error.
Notice the following:

  $ stdbuf -oL false && echo ok || echo fail
  fail

  $ stdbuf -oL true && echo ok || echo fail
  ok

  $ stdbuf -oL sh -c "exit 42" ; echo $?
  42

  $ stdbuf --version | head -n1
  stdbuf (GNU coreutils) 8.21


Can you provide more details about your error, and how to reproduce it?
(please include '--version' of your stdbuf).

Technically,
stdbuf.c calls 'execvp' ( http://lingrok.org/xref/coreutils/src/stdbuf.c#388 ),
which replaces the current process (stdbuf) with the child's program.
Unless there's an error executing the child program, the returned exit code does not come from stdbuf at all.


regards,
 - assaf





Reply sent to Assaf Gordon <assafgordon <at> gmail.com>:
You have taken responsibility. (Wed, 04 May 2016 20:17:02 GMT) Full text and rfc822 format available.

Notification sent to "Larry Wilson" <lwilson <at> jlg-tech.com>:
bug acknowledged by developer. (Wed, 04 May 2016 20:17:02 GMT) Full text and rfc822 format available.

Message #13 received at 23448-done <at> debbugs.gnu.org (full text, mbox):

From: Assaf Gordon <assafgordon <at> gmail.com>
To: Larry Wilson <lwilson <at> jlg-tech.com>, 23448-done <at> debbugs.gnu.org
Subject: Re: bug#23448: stdbuf exit code does not reflect child status
Date: Wed, 4 May 2016 16:16:32 -0400
tag 23448 notabug
thanks

Closed based on off-list response from submitter.

-assaf






bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 02 Jun 2016 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 24 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.