help-bash
[Top][All Lists]
Advanced

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

Re: HISTCONTROL doesn't erase dups


From: Chet Ramey
Subject: Re: HISTCONTROL doesn't erase dups
Date: Tue, 20 Jan 2026 12:09:21 -0500
User-agent: Mozilla Thunderbird

On 1/19/26 5:10 PM, NBaH via wrote:
hi,

shouldn't

HISTCONTROL=ignoreboth:erasedups

first, not store "contiguous" identical commands
then, not store command beginning with a space
and, remove previous same command in the history file

I can't reproduce this. The `erasedups' option will remove duplicate
entries from the in-memory history list. If you use `history -w' to
overwrite the history file, you will see this happens. If you append
the history at the end of your session, or use some other mechanism
to write the history file, it won't touch the deleted history entries,
since those were not entered into the history during the current shell
session.

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

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


reply via email to

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