[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Suggestions
. . -> [Subject]  Eliminate duplicates in command history

Eliminate duplicates in command history

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by godefroi   (17 posts)  [Biography] bio
Date Mon 16 Aug 2004 07:11 PM (UTC)
Message
Similar to the "Discard Old Duplicates" option for the command prompt in Windows, or the HISTCONTROL=ignoredups option for the bash shell in *nix.

Basically, it means that if a command is already in the command history, it removes it before adding it again so you don't get duplicates. If you entered commands such as the following:

a
b
b
a
c
d

Currently you'd get d,c,a,b,a in your command history. If you enabled this option you should get d,c,a,b in your history.
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #1 on Mon 16 Aug 2004 08:50 PM (UTC)
Message
But that would break any scripts that send the "last command" from the history. History is what youve sent, in order. What would the purpose of an option such as this?

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #2 on Tue 17 Aug 2004 09:17 PM (UTC)
Message
No, he means remove it from history before adding it. Such an option would be useful and would reduce the time it takes to browse the history... Can it be easily implemented?

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Gedrean   USA  (12 posts)  [Biography] bio
Date Reply #3 on Wed 18 Aug 2004 05:42 PM (UTC)
Message
Such a feature would be good only if it were optional, not permanent.

I'm not special! I just code my brains out for you!
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #4 on Wed 18 Aug 2004 08:48 PM (UTC)
Message
I agree, it has to be an option.

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #5 on Wed 18 Aug 2004 10:05 PM (UTC)
Message
A command history that doesn't have duplicates? Sounds like getting a book and reducing its size by eliminating all the duplicated words (eg. the word "the" seems to occur an awful lot, is it really necessary?).

Seriously, I suppose it could be done. You could also write a script that scans the command history and makes a list of unique entries, if that is what you want, for some reason.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by godefroi   (17 posts)  [Biography] bio
Date Reply #6 on Thu 19 Aug 2004 11:15 PM (UTC)

Amended on Thu 19 Aug 2004 11:16 PM (UTC) by godefroi

Message
For example,

cast a
cast b
cast c
cast a
cast b
cast a
cast b
cast a
cast b

now, if I want to cast c again, I have to go up through b,a,b,a,b,a to c.

If elim dupes were on, I would go through b,a to c.

The logic change is simply to remove all "x" from the command history before adding "x" at the end

The command prompt in windows has the option, as does bash in *nix. Someone thought it was useful.
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #7 on Sun 22 Aug 2004 10:07 AM (UTC)
Message
It makes no sense for the command history to have duplicates, because it's there to help you type faster, not provide you with the entire history of what you had typed, I think. Such an option would help you find what you want faster.

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #8 on Tue 24 Aug 2004 10:50 PM (UTC)
Message
Added as suggestion #527.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


20,722 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]