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

WAD HISTORY /R, No closing quote?

Discussion in 'Support' started by vefatica, Jan 20, 2013.

  1. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,952
    Likes Received:
    30
    I wouldn't expect "HISTORY /R" to do any interpreting. So why does this happen?
    Code:
    v:\> history > hist120.txt
     
    v:\> history /r hist120.txt
    TCC: No closing quote
     
  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,859
    Likes Received:
    83
    Not reproducible here. HISTORY /R doesn't do any parsing of the input lines, except for checking for a line continuation. Does this happen with any history file or just "hist120.txt"? Can you email me the contents of "hist120.txt"?

    (HISTORY /R hasn't changed for quite a while.)
     
  3. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,952
    Likes Received:
    30
    I don't know how long it has gone on. I noticed it a few days ago at logon when my logon script starts (my) SHRALIAS and loads the SHRALIAS dump files. And HIST120.txt was just made today. So, I suppose there's something in my history right now that causes it (but I don't know how since, as you said and as I figured, HISTORY /R doesn't do any parsing. Right now there are 5021 unique lines in my history, it might take a while but I'll try to figure out if one of them causes the error message. After removing passwords from hist120.txt, if it still misbehaves, I'll email it.
     
  4. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,952
    Likes Received:
    30
    The line causing it has a single (unmatched) back-quote at the end. Here's the whole file (whittled down to one line by a binary search).
    Code:
    v:\> type hist120.txt
    http://forecast.weather.gov/MapClick.php?CityName=Syracuse&state=NY&site=BGM&textField1=43.0446&textField2=-76.1459&e=0`
     
    v:\> history /r hist120.txt
    TCC: No closing quote
     
  5. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,952
    Likes Received:
    30
    Here's a little self-contained test that produces an odd result (but not the error message). How did the line "histtest.txt" get in there?
    Code:
    v:\> echo foo^k > histtest.txt
     
    v:\> type histtest.txt
    foo`
     
    v:\> history /r /a histtest.txt
     
    v:\> history | tail /n5
    echo foo^k > histtest.txt
    type histtest.txt
    history /r /a histtest.txt
    histtest.txt
    history | tail /n5
     
  6. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,859
    Likes Received:
    83
    Still not reproducible here. Just doing a HISTORY /R isn't going to do anything with the line, regardless of the trailing character (unless it's a ^). Do you have any pre- or post-exec aliases? Have you tried it with plugins disabled?
     
  7. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,859
    Likes Received:
    83
    "Histtest.txt" got there because you told TCC to add it.

    The /A option adds the specified command to the history. In this case, the command you specified was "histtest.txt". The combination of /R then told HISTORY to read an unspecified file and append the contents to the command history. All in all, a strange command line, though TCC faithfully executed your request. (What were you actually intending to do?)
     
  8. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,952
    Likes Received:
    30
    I didn't look at the help. I thought "/A file" meant /A(ppend) the contents of the file (now I see that's the default). Note, the appending of the file contents, "foo`", (which was my goal) didn't happen. I'll admit it ... screwy command line.
     
  9. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,859
    Likes Received:
    83
    The reading & appending of the file didn't happen because the /A is processed first. /A gets the remainder of the line, appends it to the history list, and exits HISTORY. (No point in looking for anything else, because you told it when you specified /A that you wanted the entire following command appended to the history.)
     
  10. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,859
    Likes Received:
    83
    I went through the HISTORY /R code line by line, and I'm 100% certain your problem isn't with HISTORY /R, which definitely does not do any parsing of the file, ever. (Except for the aforementioned check for an escape as the last character on a line).

    HOWEVER ... if you have defined HistoryExclude, then before the line is added to the history, the first command is extracted so it can be compared to the HistoryExclude value. (This is true of every way you might add a line to the history, not just HISTORY /R.) If you have mismatched back quotes, they can trigger an error message then (though that won't prevent HISTORY from adding the line). I don't consider this a bug, because you'd get the same error message if you entered it on the command line.

    There has to be more to this than you've told me so far ...
     
  11. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,952
    Likes Received:
    30
    More ... HistoryExclude. It is set. And when I unset it I can't produce the error message. It's no big deal if you leave it alone; I just didn't understand where the message came from.
     

Share This Page