From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id DC2016DE0EF9 for ; Sun, 10 Mar 2019 17:12:01 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.334 X-Spam-Level: X-Spam-Status: No, score=-0.334 tagged_above=-999 required=5 tests=[AWL=-0.334, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F4mi5_UsH1uj for ; Sun, 10 Mar 2019 17:12:00 -0700 (PDT) Received: from wp260.webpack.hosteurope.de (wp260.webpack.hosteurope.de [80.237.133.29]) by arlo.cworth.org (Postfix) with ESMTPS id 89DB76DE0EDC for ; Sun, 10 Mar 2019 17:12:00 -0700 (PDT) Received: from p200300cb273ada0124d27f36daada354.dip0.t-ipconnect.de ([2003:cb:273a:da01:24d2:7f36:daad:a354] helo=deneb.skynet.aixah.de); authenticated by wp260.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1h38Xs-0006Us-FP; Mon, 11 Mar 2019 01:11:56 +0100 Received: by deneb.skynet.aixah.de (Postfix, from userid 1005) id BAD21C0305; Mon, 11 Mar 2019 01:11:55 +0100 (CET) Date: Mon, 11 Mar 2019 01:11:55 +0100 From: Luis Ressel To: Tomi Ollila Cc: notmuch@notmuchmail.org Subject: Re: [PATCH] test/T030-config: Separate stdout and stderr output Message-ID: <20190311001155.5w2nhppan2wk2erj@deneb.skynet.aixah.de> Mail-Followup-To: Tomi Ollila , notmuch@notmuchmail.org References: <20190310164202.4798-1-aranea@aixah.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-bounce-key: webpack.hosteurope.de;aranea@aixah.de;1552263120;57d958ac; X-HE-SMSGID: 1h38Xs-0006Us-FP X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Mar 2019 00:12:02 -0000 On Sun, Mar 10, 2019 at 10:42:59PM +0200, Tomi Ollila wrote: > On Sun, Mar 10 2019, Luis Ressel wrote: > > > test_begin_subtest "List all items" > > -notmuch config list 2>&1 | notmuch_config_sanitize > OUTPUT > > +notmuch config list 2>OUTPUT-ERR | notmuch_config_sanitize > OUTPUT > > +echo "====" >> OUTPUT > > +notmuch_config_sanitize < OUTPUT-ERR >> OUTPUT > > IMO the above would be better (model/pattern for further use) as: > > notmuch config list >STDOUT 2>STDERR > { cat STDOUT; echo "===="; cat STDERR; } | notmuch_config_sanitize > OUTPUT Yes, that'd certainly look better. > (I would like to put that cat-echo-cat into function but naming is hard...) "concat" perhaps? Or "concat_separator"/"concat_with_separator"? > alternatives: > > 1) drop ====, then one cat STDOUT STDERR ... would be enough > > 2) printf '%s====\n%s' "$(< STDOUT)" "$(< STDERR)" > > 3) head -1000 STDOUT STDERR > > -- in case of (3) are we sure that all head(1) implementations print the > filenames (and formats (possible) extra newlines) the same way. > > -- ( (2) brings $(< ...) (faster replacement for $(cat ...) which we > haven't used in notmuch test suite so far -- but we could!) Any of those options would be fine with me, with a preference for 2). As for 3), POSIX specifies the exact header format head should use: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/head.html (There may be nonconformant implementations anyway, of course.) Regards, Luis Ressel