WAD HISTORY /R, No closing quote?

May 20, 2008
11,543
104
Syracuse, NY, USA
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
 

rconn

Administrator
Staff member
May 14, 2008
12,406
152
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.)
 
May 20, 2008
11,543
104
Syracuse, NY, USA
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.)
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.
 
May 20, 2008
11,543
104
Syracuse, NY, USA
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
 
May 20, 2008
11,543
104
Syracuse, NY, USA
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
 

rconn

Administrator
Staff member
May 14, 2008
12,406
152
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).

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?
 

rconn

Administrator
Staff member
May 14, 2008
12,406
152
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

"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?)
 
May 20, 2008
11,543
104
Syracuse, NY, USA
"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 "histtest.txt" 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?)
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.
 

rconn

Administrator
Staff member
May 14, 2008
12,406
152
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.

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.)
 

rconn

Administrator
Staff member
May 14, 2008
12,406
152
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 ...
 
May 20, 2008
11,543
104
Syracuse, NY, USA
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 ...
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.
 
Similar threads
Thread starter Title Forum Replies Date
J History file load hangs if file has complete garbage in it... Support 1
R History window wrong size, can't remember size change Support 12
T How to? retain command history across reboot? Support 6
nikbackm Speeding up the history dialog Support 6
D ParentDirectory does not update directory history Support 6
vefatica Command history search is off Support 7
D Directory History Window with wildcard search Support 3
R Long commands retrieved from command history have blank line when wrapped Support 20
Joe Caverly @HISTORY issues Support 4
vefatica Deleting entries in the command history popup? Support 3
H History and TPipe Oddness Support 3
D History and control-C Support 1
G Console exe up / down history Support 8
D What does the file "..\Everything\Run history.csv" store? Support 5
rps Cmd history recall Support 4
David McClelland Command history loosing entries Support 18
R history features. Support 6
rps How to? Shralias and producing history.sav, alias.sav .. Support 6
M Ctrl-C when using command line history does nothing Support 2
S Debugger Bat file call history Support 9
Charles Dye Ctrl-Shift-Up doesn't update directory history Support 1
vefatica ESC after recalling a command from history Support 3
T TCHelp executable history? Support 2
thorntonpg @blahblah added to history. Support 0
M Call History popup-window? Support 0
M HISTORY lessons ... Support 0
vefatica The help and IE's history Support 16
D Towards shared (dir-)history lists Support 3
vefatica Ctrl-Enter in command history window? Support 8
vefatica History recall turns off Quick-Edit Support 4
C history is getting deleted under unknown circumstances Support 9
R V19 - At startup, TCC save directory in the directory history list Support 2
T [TCC 18] Can't read nor write history Support 1
I Possible Bug: History /n Returns Nothing Support 3
jbanaszczyk Lost history Support 4
T history.sav Support 4
T How to? sort history in tcexit.btm Support 22
vefatica OT: Windows console history? Support 7
S directory history locks up TCC Support 3
R In addition to ALIAS /Z and FUNCTION /Z, HISTORY /Z? Support 1
E TCC History popups too small Support 0
C How to? Keeping all history lists Support 4
E Command History not showing on up arrow button Support 8
nikbackm HISTORY /R1 performance Support 3
T Selecting line from popup history without executing Support 8
A How to? Filter history list with unicode chars Support 0
vefatica WAD DO /S ... all dirs wind up in the history! Support 12
D Dir History file check Support 18
ehab aboudaya How to? Command Input history for each tab? Support 0
A Ctrl-1 and the command history Support 5

Similar threads