Path: csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: Eduardo Bustamante Newsgroups: gnu.bash.bug Subject: Re: Incorrect passing of argc argv with multiple redirects Date: Tue, 30 Jul 2019 10:56:29 -0700 Lines: 11 Approved: bug-bash@gnu.org Message-ID: References: NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: usenet.stanford.edu 1564509405 12554 209.51.188.17 (30 Jul 2019 17:56:45 GMT) X-Complaints-To: action@cs.stanford.edu Cc: bug-bash To: Morgan McClure Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Y87gPuF//6MbuNNYHvTmVDx/jAAbrn43ou31QZCCxAU=; b=j555/JBt4BAjspMifoqwR5y91jN35P1dtYzPDY2C7KXsy8/fRU3AV5oxZEDvA9RlKY g61WTuFNXgmXuR8lWdUIKfhkZX+t+JcmyCbr2NABrhiv1GrI2ayeWPbJjB4+5VaRSUGP pi29hGhpkSX66EYVXqJlVfYcvfXn1OntF33oEoSPzdhnMqxgQAgqjZavbncH1P2alwR7 Rfny6YSgBmipf3GfeuQptR/RxSN104xtDIcCkia8tcOw5Fhv+lTwc7Mh94kkdqvueiNL CCahlnw5gd7YhjnTL1/1eJ3EMxq3YHC5cXN6d5oWe1k1CUxMGApE65Ej5q9q2ID1yA+a xmpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Y87gPuF//6MbuNNYHvTmVDx/jAAbrn43ou31QZCCxAU=; b=GhEtaSR/IlwbxfoG1X8gPjg96xgxhVo9KUeHqjf71nKswHz0YBDCU7iVX3Hy9IqIVf wnRT6ti5NpNC355XXkaoTrCH9yKQbnqIgwBb44LFO1ONqkiGoTbaJXI6WM41E6BpYmWn qKJQYXAa15QuREjr/DYuR1euHkjPa9RMJiyE9V3WozDGm5YQifsIvyBMAKQrmh21Uy7b HaR22Neg3aWi/KZtWkzPXw+qw9aztDxu7VcRGd5LxfSam5/8hRb+GyHZNKDligigZhCh DpuTfzIK/Mb6zbW1pPjwMXS5zqxoQfBnj8QjnY/kGTr8nYuVR9FG3MwJyVe9gyOjVZAO pmWA== X-Gm-Message-State: APjAAAVqsplhAjs8kBKe/9dqqY68FhXi+zB0QTYcbSb7wXep2Y9JCQ8n RPHzrvIvBnTjt9F1o+PX53a1jDgpXGxKYEoPqTk= X-Google-Smtp-Source: APXvYqywsGklDCFCTmjvIO+Nh/r3oVf5mZaOx3skJ3n0GUSQu8h3Tto3tPD/bf86PqnLk7oPA9pgjX8pwBc3JyKu8UE= X-Received: by 2002:ab0:30e1:: with SMTP id d1mr9273706uam.112.1564509400264; Tue, 30 Jul 2019 10:56:40 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::933 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: Xref: csiph.com gnu.bash.bug:15281 On Tue, Jul 30, 2019 at 10:35 AM Morgan McClure wrote: (...) > ./a.out foo > /dev/null 2&>1; echo $? > returns 3 NOT as expected Are you 100% certain the `2&>1` redirection means what you think it means? (hint: I recommend reading the "Redirecting Standard Output and Standard Error" section of the bash manual, check if the leading `2` is valid there).