Re: hash -l with empty hash table prints to stdout
From:
Dale R. Worley
Subject:
Re: hash -l with empty hash table prints to stdout
Date:
Tue, 16 Jun 2020 22:13:33 -0400
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". Maybe you could make the empty
message be a comment?
$ hash -l
# hash: hash table empty
That is acceptable input for bash, has the right effect when read by
bash, is human-readable, and is capturable by redirecting stdout.
Dale