[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: hash -l with empty hash table prints to stdout
From: |
Eli Schwartz |
Subject: |
Re: hash -l with empty hash table prints to stdout |
Date: |
Tue, 16 Jun 2020 09:46:19 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 |
On 6/16/20 9:30 AM, Chet Ramey wrote:
> On 6/15/20 4:47 PM, beluro@web.de wrote:
>
>> Bash Version: 5.0
>> Patch Level: 3
>> Release Status: release
>>
>> Description:
>
>> `hash -l' is supposed to generate output that is reusable as input
>> (`help hash' says so, at least). In case the hash table is empty, a
>> string not re-usable as input is output to stdout. The exit code
>> indicates success in this case. The string being output is locale-
>> dependant (and therefore is hard to filter out in a work-around).
>
> It's an interesting question. An empty hash table is not an error
> condition, and doesn't result in a non-zero exit status, so output to
> stderr is not appropriate. You might want to temporarily enable posix mode,
> which suppresses the message.
stderr is also a reasonably appropriate place to emit debug info or
warnings. I would consider this a warning condition...
--
Eli Schwartz
Arch Linux Bug Wrangler and Trusted User
signature.asc
Description: OpenPGP digital signature
Re: hash -l with empty hash table prints to stdout, Dale R. Worley, 2020/06/16