Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #16392

Re: hash -l with empty hash table prints to stdout

From worley@alum.mit.edu (Dale R. Worley)
Newsgroups gnu.bash.bug
Subject Re: hash -l with empty hash table prints to stdout
Date 2020-06-16 22:13 -0400
Message-ID <mailman.2031.1592360021.2541.bug-bash@gnu.org> (permalink)
References <bd77214b-2690-f5de-a814-108e5be8b6f1@case.edu> <87o8pi4eya.fsf@hobgoblin.ariadne.com>

Show all headers | View raw


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

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: hash -l with empty hash table prints to stdout worley@alum.mit.edu (Dale R. Worley) - 2020-06-16 22:13 -0400

csiph-web