bug-bash
[Top][All Lists]
Advanced

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

Re: HISTCONTROL=erasedups is ignored while saving history


From: Chet Ramey
Subject: Re: HISTCONTROL=erasedups is ignored while saving history
Date: Sun, 03 Feb 2013 22:58:46 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/17.0 Thunderbird/17.0

On 2/3/13 3:44 AM, Alfonsas Stonis wrote:

> 
> Bash Version: 4.2
> Patch Level: 37
> Release Status: release
> 
> Description:
>     HISTCONTROL=erasedups affects only what is showen by history command,
> but does not affect what is saved. Repeated commands are still added to
> history file completely ignoring HISTCONTROL.
> 
> Repeat-By:
>     Type the same comand few times. For exmple: ls, ls
>     Type history and you will see only one ls command
>     Exit bash
>     Enter bash and type history. You will see repeated ls command.

I don't see this:

z4(1)$ HISTFILE=histfile ./bash
z4(2)$ history
    1  history
z4(2)$ echo a
a
z4(2)$ echo b
b
z4(2)$ echo c
c
z4(2)$ exit
exit
z4(1)$ cat histfile
history
echo a
echo b
echo c
exit
z4(1)$ HISTFILE=histfile ./bash
z4(2)$ HISTCONTROL=erasedups
z4(2)$ ls
z4(2)$ ls
z4(2)$ history
    1  echo a
    2  echo b
    3  echo c
    4  exit
    5  HISTCONTROL=erasedups
    6  ls
    7  history
z4(2)$ exit
exit
z4(1)$ cat histfile
history
echo a
echo b
echo c
exit
HISTCONTROL=erasedups
ls
history
exit

(I omitted the `ls' output.)
The history file does not contain multiple `ls' commands.

Chet

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



reply via email to

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