Re: sh exit status ($?) for exec failures

2017-07-03 Thread Robert Elz
Date:Mon, 3 Jul 2017 11:05:50 +0200 From:Joerg Schilling Message-ID: <595a08ee.2ks0pwgoaY/w1vz2%joerg.schill...@fokus.fraunhofer.de> | The POSIXified ksh88 returns 127 for ENOENT and 126 in all other cases. Thanks, and to Chet for the earlier reply. That seems li

Re: sh exit status ($?) for exec failures

2017-07-03 Thread Joerg Schilling
Robert Elz wrote: > When the shell has to exec a utility, if the exec*() it performs fails, > it has to reflect that status (failure) back to the calling process > (usually for our purposes, the script). > > XCU 2.8.2 includes ... (lines wrapped for e-mail) > > 75455 If a command is not found, th

Re: sh exit status ($?) for exec failures

2017-07-02 Thread Chet Ramey
On 7/1/17 8:01 PM, Robert Elz wrote: > | 126 covers errors when those checks done and exec() is expected to not > | fail but does anyways, > > It reads to me as being intended to be somewhat more specific than that. > in any case, in this situation, there are no (relevant) checks, simply an >

Re: sh exit status ($?) for exec failures

2017-07-01 Thread Robert Elz
Date:Sat, 1 Jul 2017 18:30:59 -0400 From:Shware Systems Message-ID: <15d00474c8b-973-b...@webprd-a49.mail.aol.com> | A shell can use more codes as an extension, Yes, I know that. | but this is not recommended to leave as much room for application | specific re

RE: sh exit status ($?) for exec failures

2017-07-01 Thread Shware Systems
A shell can use more codes as an extension, but this is not recommended to leave as much room for application specific return values as is practical. I view it as 127 covers errors related to path resolution/setting up the exec() attempt, including determining in an unspecified manner whether the

sh exit status ($?) for exec failures

2017-07-01 Thread Robert Elz
When the shell has to exec a utility, if the exec*() it performs fails, it has to reflect that status (failure) back to the calling process (usually for our purposes, the script). XCU 2.8.2 includes ... (lines wrapped for e-mail) 75455 If a command is not found, the exit status shall be 127.