[Tfug] bash history duplication?

Matt Jacob matt.jacob at gmail.com
Thu Jun 28 11:57:06 MST 2007


Hmm... In the words of Bugzilla, "WORKSFORME". Check this out:

mjacob at ned:~$ history -c
mjacob at ned:~$ pwd
/home/mjacob
mjacob at ned:~$ pwd
/home/mjacob
mjacob at ned:~$ pwd
/home/mjacob
mjacob at ned:~$ history
     3  pwd
     4  history

So that appeared to do what it was supposed to. And then I alternate 
some commands so that the last command and the current command are 
different:

mjacob at ned:~$ history -c
mjacob at ned:~$ pwd
/home/mjacob
mjacob at ned:~$ uptime
  11:52:40 up 2 days,  3:40,  1 user,  load average: 0.00, 0.00, 0.00
mjacob at ned:~$ pwd
/home/mjacob
mjacob at ned:~$ uptime
  11:52:47 up 2 days,  3:41,  1 user,  load average: 0.00, 0.00, 0.00
mjacob at ned:~$ history
     3  pwd
     4  uptime
     5  pwd
     6  uptime
     7  history

And history picked those up like it was supposed to. Maybe echo 
$HISTCONTROL and see if it's actually set like you think it is.

Matt

Earl wrote:
> That is what I take it to mean too but it isn't happening.
> 
> Earl
> "God made man, Sam Colt made men equal."
> "The fates guide him who will, him who won't they drag" Spengler
> 
> -- Matt Jacob <matt.jacob at gmail.com> wrote:
> My man page says: "If set to a value of ignoredups, lines matching the 
> last history line are not entered."
> 
> I take that to mean that 'ls' followed by 'pwd' followed by 'uptime' 
> will all show up, while 'ls', 'ls', 'ls' will only show one occurrence 
> of ls.
> 
> Matt
> 
> Earl wrote:
>> I have a default line in my .bashrc file that says 
>>
>> export HISTCONTROL=ignoredups
>>
>> after reading the man page for bash(1), I understand this means
>> duplications won't happen.  I get dups.
>>
>> Earl
>>
>> This computer is M$ and i386 free
>> "God made man, Sam Colt made men equal."
>> "The fates guide him who will, him who won't they drag" Spengler
>>
>>
>> _______________________________________________
>> Tucson Free Unix Group - tfug at tfug.org
>> Subscription Options:
>> http://www.tfug.org/mailman/listinfo/tfug_tfug.org
>>
> 
> _______________________________________________
> Tucson Free Unix Group - tfug at tfug.org
> Subscription Options:
> http://www.tfug.org/mailman/listinfo/tfug_tfug.org
> 
> 
> 




More information about the tfug mailing list