1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SHRALIAS and command history

Discussion in 'Support' started by ron, Sep 2, 2011.

  1. ron

    ron

    Joined:
    Aug 19, 2008
    Messages:
    140
    Likes Received:
    0
    What determines the amount of history "SHRALIAS" will save to a file when SHRALIAS_SAVE_PATH=c:\ProgramData\JPSoft is set?

    The reason I ask is, when starting with this...

    history.sav 20,783 08/28/2011 18:36 -a--

    D:\>shralias
    D:\>history /r history.sav
    D:\>shralias /u

    I end up with this in c:\ProgramData\JPSoft

    history.sav 16,778 09/02/2011 09:54 -a--

    The original file has 663 commands and the one saved by SHRALIAS has "255".
     
  2. ron

    ron

    Joined:
    Aug 19, 2008
    Messages:
    140
    Likes Received:
    0
    Let's add to the goofy behavior...

    In TC13, it's not as destructive. 664 reduced to 628. The diff is easier to analyze here too. SHRALIAS removed all but 4 of the first 41 commands. The remainder are intact when compared to the original.

    That's 664 and 628 individual command lines, not bytes.
     
  3. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,870
    Likes Received:
    83
    SHRALIAS will save the entire list.

    What did you define as your history list size in OPTION / Command Line?
     
  4. ron

    ron

    Joined:
    Aug 19, 2008
    Messages:
    140
    Likes Received:
    0
    20000

    In my examples, it does not save the entire list.
     
  5. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,972
    Likes Received:
    30
    That limit is characters ... could be about right for 600-700 commands.
     
  6. ron

    ron

    Joined:
    Aug 19, 2008
    Messages:
    140
    Likes Received:
    0
    Note in my first post, the command count dropped from 663 to 255. That's allot of history to lose.
     
  7. ron

    ron

    Joined:
    Aug 19, 2008
    Messages:
    140
    Likes Received:
    0
    It could take a while to track down this issue. I created a simple command file with 2000 individual commands and none were lost using the test below.
     
  8. ron

    ron

    Joined:
    Aug 19, 2008
    Messages:
    140
    Likes Received:
    0
    Duplicates. That's the answer. When I sort -u the original file, it's reduced to 255.

    So, duplicates exist in the buffer but they get removed on save.

    Move to end / save last is my setting.

    Somehow I thought TCMD was dynamically removing duplicates from the live buffer.
     
  9. DMcCunney

    Joined:
    Jun 7, 2008
    Messages:
    96
    Likes Received:
    3
    On Fri, Sep 2, 2011 at 7:12 PM, ron <> wrote:

    Live duplicate removal has been a wish list item for years. It hasn't
    happened because it would take too much code and require too much
    overhead to do it on the fly. TCC/TCMD would have to scan the entire
    history on every command entered to see if it was a dupe. Ugh. Much
    easier to do it once on exit
    ______
    Dennis
     
  10. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,972
    Likes Received:
    30
    On Fri, 02 Sep 2011 19:12:54 -0400, ron <> wrote:

    |Duplicates. That's the answer. When I sort -u the original file, it's reduced to 255.
    |
    |So, duplicates exist in the buffer but they get removed on save.
    |
    |Move to end / save last is my setting.
    |
    |Somehow I thought TCMD was dynamically removing duplicates from the live buffer.

    SHRALIAS is pretty straightforward. It just sits on the handles so the
    memory-mapped files don't get closed, and dumps them when appropriate; it has no
    idea what's in them.

    TCC does remove dups (or otherwise honor your preferences) immediately, in the
    live buffer as you put it. Just look at the (live) history and you'll see that.
    The duplicates were probably removed when the old file (with duplicates) was
    read into the active history.
     
  11. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,972
    Likes Received:
    30
    On Fri, 02 Sep 2011 20:24:48 -0400, DMcCunney <> wrote:

    |Live duplicate removal has been a wish list item for years. It hasn't
    |happened because it would take too much code and require too much
    |overhead to do it on the fly. TCC/TCMD would have to scan the entire
    |history on every command entered to see if it was a dupe. Ugh. Much
    |easier to do it once on exit

    It *is* done live, as far as I can tell I just looked at my recent history ...
    saw "ver" seven or eight commands back ... issued "ver" again and now it's at
    the end of the history and not where it was before.
     
  12. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,870
    Likes Received:
    83
    history ...

    It is, provided you've set either "Save First" or "Save Last" in OPTION /
    Command Line / Command History / Duplicates.
     

Share This Page