bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug in Bash 4.4 Return history of commands


From: Chet Ramey
Subject: Re: Bug in Bash 4.4 Return history of commands
Date: Mon, 12 Dec 2016 14:34:51 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.5.1

On 12/12/16 12:26 PM, Arion Deno wrote:
> I believe the bug should have already been fixed .. but

It's not a bug.

> A description of the bug behaviour. :
> 
> When you type the command: history -c, to clear the bash history,
> typing bash -v appears to open all configuration files, and the
> command history returns

The bash history list is kept in memory, read from $HISTFILE at shell
startup, and written to $HISTFILE when the shell exits.  You can use
the `history' builtin to force reads and writes when you want.

history -c clears the in-memory history list, but has no effect on the
contents of $HISTFILE.

bash -v starts a new instance of bash with the -v option, which prints
commands, line by line, as they are read from wherever the shell reads
input.  This includes commands read while the shell is executing startup
files.

Since you didn't change the contents of $HISTFILE, the new instance of
bash reads the history from it when it starts up.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]