X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; q=dns; s=default; b=jz BvAQz5nnODpaG687aRo874PSPNLCbmY8e0CDEsulvXG/oZoguVgij0BhsiPnYZTh QnGiWATofgPjEoypo19lXBvq6I8FHICpdKnh3cmUncyUJ+TF7zIJGPG6OCxAt9E+ PN1e62LTzkCjKVowj3erJ2kqJS44RPbsWai61LnSA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; s=default; bh=sndL5Clj mzVzpuij6CouRe3J+Rs=; b=P3+pgFkdjzCB6tRvUWa74kkC1NS74jtJk7GaZGhh priocg9VuI+WIWsazik4rN6Up/jPrXmlKR4ORgPRMvigIS1OD3YH8kMAadrVadKn Pwq/6ZbkX23BmgE0gm5SgeiS7neDFnoS4E7wUxCkmGNreZ4TdWup9z2PJOfiZW/s Wro= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.4 required=5.0 tests=AWL,BAYES_50,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-yk0-f179.google.com MIME-Version: 1.0 X-Received: by 10.170.185.200 with SMTP id b191mr20182831yke.85.1436487659979; Thu, 09 Jul 2015 17:20:59 -0700 (PDT) In-Reply-To: <1436485372.7208.77.camel@cygwin.com> References: <1436485372 DOT 7208 DOT 77 DOT camel AT cygwin DOT com> Date: Thu, 9 Jul 2015 20:20:59 -0400 Message-ID: Subject: Re: Return codes over 1 byte From: Michael DePaulo To: The Cygwin Mailing List Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes On Thu, Jul 9, 2015 at 7:42 PM, Yaakov Selkowitz wrote: > On Thu, 2015-07-09 at 19:30 -0400, Michael DePaulo wrote: >> mark06 mentioned this on IRC today and then left the channel about 1 hour later: >> >> has anyone ever discussed exit codes above one byte? they are >> valid on modern windows, but cygwin's bash will mess them >> >> I was curious, so I googled it (I could not find an answer) and then >> tried it out. I can confirm the what he said. > > http://pubs.opengroup.org/onlinepubs/9699919799/functions/exit.html > https://www.gnu.org/software/libc/manual/html_node/Exit-Status.html > > -- > Yaakov Right, only the least significant 8 bits are outputted. So "257" becomes "1". I thought I read somewhere that the Cygwin mintty terminal + bash shell is supposed to be suitable for running native windows apps. Maybe I was thinking of the 1st paragraph on this page after the list of features: https://code.google.com/p/mintty/ Or maybe I was thinking about this reply: https://cygwin.com/ml/cygwin/2007-03/msg00758.html Either way, I feel like this should be documented somewhere. Perhaps I should submit a patch to add a section like "return codes" to to this page? https://cygwin.com/cygwin-ug-net/using-effectively.html https://cygwin.com/git/gitweb.cgi?p=newlib-cygwin.git;a=blob;f=winsup/doc/effectively.xml -Mike -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple