Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

WAD HISTORY /R, No closing quote?

May
13,191
180
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
 
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.)
 
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.
 
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
 
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
 
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?
 
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?)
 
"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.
 
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.)
 
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 ...
 
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.
 
Back
Top
[FOX] Ultimate Translator
Translate