Path: csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail From: Eli Schwartz Newsgroups: gnu.bash.bug Subject: Re: hash -l with empty hash table prints to stdout Date: Tue, 16 Jun 2020 22:38:51 -0400 Lines: 80 Approved: bug-bash@gnu.org Message-ID: References: <87o8pi4eya.fsf@hobgoblin.ariadne.com> <8788c02a-fcbd-9126-391e-718cc2e0a3de@archlinux.org> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="628hV0C0gvMhP4twtZFfGDkRgKhx8qRrP" X-Trace: usenet.stanford.edu 1592361550 15371 209.51.188.17 (17 Jun 2020 02:39:10 GMT) X-Complaints-To: action@cs.stanford.edu To: bug-bash@gnu.org Envelope-to: bug-bash@gnu.org X-Spam-BL-Results: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=archlinux.org; s=orion; t=1592361535; bh=HiAFnNuw7dJlxkiKYbqD8k7Hx6G/o+oYeTpTjpZkQTk=; h=Subject:To:References:From:Date:In-Reply-To; b=lrrNuJqf1i/tD5qIuoMbCkySSjtnLvLl3HAI8WT1WRn/Qj6qpvONFgLJNmGFm5VKw t3r6S29SgaW31/HCGdEpRa38SmLAc6YSeoUsazHsDK9Mpsw/qOYyWcBT4UtYvA6h8a T7eDGUeMhm+okuspInBrJGU1iNeVC1dIOvBUYoXoQJGWgJbUe/feAzM/HIOu98Mi7k QKvNUfkNZBttkRZkGECFTC5Lm9qJ43c5hauEEOuVit5WwpIU8gnhq9q2TKT+fjtt3J ydfBtPERDJCk7tuM5Tg0cjp3/rIMO3Dgbjcf8IvBqLO7zD8jb1OC8lbyk21XmatlaG OPyhnJ3T16TBi+bL1EccG5H2h25gCGFzGnKgcI1MbMhq31cmm02Ygtjt1uozWQtYfX m/X9/WAR+t8jIMe07vDZ/LHZF/SOiofiq4A2/fcEHEJNl7+fRlLKjsYRdbiMeXqbpR YI+fVo1xI5f6ecU6sbjsxvLyiNjnqvqcR0mgY5TfBERD3V7MnCThrz/TuLU8DdDKLq oVee+U+vLHE1PTXdHnCWQqldOja3Zrnpuy1Dd3W4ekPSlej0LCci+dUMi/OfXBcraq c7c/1LKtKeOluTp0D2E1klO5ogTWM9Q9OCgqHZUqv2oQ/odnuM3TlX+RrnNOZ95Qd6 GLpiOKQ95ljtvcoal2PrVtH4= X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 In-Reply-To: <87o8pi4eya.fsf@hobgoblin.ariadne.com> Received-SPF: pass client-ip=2a01:4f8:160:6087::1; envelope-from=eschwartz@archlinux.org; helo=orion.archlinux.org X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -53 X-Spam_score: -5.4 X-Spam_bar: ----- X-Spam_report: (-5.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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: <8788c02a-fcbd-9126-391e-718cc2e0a3de@archlinux.org> X-Mailman-Original-References: <87o8pi4eya.fsf@hobgoblin.ariadne.com> Xref: csiph.com gnu.bash.bug:16393 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --628hV0C0gvMhP4twtZFfGDkRgKhx8qRrP Content-Type: multipart/mixed; boundary="K2CANjIX4Rd8w7wj8eIlGmDn78CtiLTYv" --K2CANjIX4Rd8w7wj8eIlGmDn78CtiLTYv Content-Type: text/plain; charset=utf-8 Content-Language: en-US-large Content-Transfer-Encoding: quoted-printable On 6/16/20 10:13 PM, Dale R. Worley wrote: > What a weird problem! Yes, "hash -l" should produce output that can be= > read by bash. But sending the "bash: hash table empty" message to > stderr put you in the situation where "hash -l >file" doesn't really > leave the output of "hash -l" in "file". =20 Of course it would. The output of hash -l would be "bash-parseable code to recreate the hash table", as in fact is currently documented. And *diagnostic* messages are not output, and should not be treated as output, and don't belong in that file one way or another. If one really, truly wanted to collect both the expected output *and* the diagnostic messages, one could redirect stderr too... but I don't foresee this as being a problem. ;) People would be more likely to redirect it to /dev/null. > Maybe you could make the empty > message be a comment? >=20 > $ hash -l > # hash: hash table empty >=20 > That is acceptable input for bash, has the right effect when read by > bash, is human-readable, and is capturable by redirecting stdout. As I suggested, yes. :) --=20 Eli Schwartz Arch Linux Bug Wrangler and Trusted User --K2CANjIX4Rd8w7wj8eIlGmDn78CtiLTYv-- --628hV0C0gvMhP4twtZFfGDkRgKhx8qRrP Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEvSewel70XCra9w4EhIGKaBmvSpsFAl7pgjsACgkQhIGKaBmv SpsvJA/+POAGmnmbLMkZkmLaGOOhzXdJWMhHKLdRYQHzXEy2dLrxlpm7DLRNr2Mu S4oCAGZI+J00+arBBI5LnffUjn/wNYjgg/BIhdLGo+g9xj7jF13kq4jxWnyIGXh9 E/DpzImsePjYTGcAvcow/Vef+f9VaHjkMNRspWYUqvQN4ZfWCX2F/mxk6OVqbrr/ XIuAZJQXZzGGSYTxLymmE1jQeXK12vO1L206nxjh6XKsYNcR2VRr6uTV8jrX9raB F4ZALKR5j2ZCztQaA8QzoUT/hREnF5jnUi5kNPOhp+daMhLkxsGpu++Obqqnn5/l tPevZkap/9smzI4+3GE3fLl4as1UpJbC+qiNXiRC0bOzw8CypguA6eTFfQH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