By registering with us, you'll be able to discuss, share and private message with other members of our community.
SignUp Now!What are you trying (and what goes wrong)? I'd try (with paths if necessary):
Code:sort history.txt /o history.txt
history | sort > (path\)myhistory.txt
history /r (path\)myhistory.txt
(My mistake) TCC is starting another TCC to execute sort. That TCC also executes TCEXIT.BTM ... and so on. Use an "in-process" pipe.Doesn't work: I had to run tcexit manually to see this:
TCC: C:\Program Files\JPSoft\TCMD16x64\TCEXIT.btm [4] Exceeded batch nesting limit
TCC: C:\Program Files\JPSoft\TCMD16x64\TCEXIT.btm [4] Exceeded batch nesting limit
tcexit looks like this:
history |! sort > (path\)myhistory.txt
Did you clear the "History File" box in the OPTION dialog ("Command Line" tab)? If you don't, TCC will have the last word.your approach works - but the problem remains that the history in memory (unsorted) replaces the sorted history list on exit.
Logging should be using a file different from the "History file". I have command log files going back years (10-12 MB). The log mechanism should have no effect on the command history mechanism.Tom - are you LOGging every command? If so you can't modify a file the same time a utility is - like SORT ...
LOG OFF
history >! %temp\MyHistory.txt
SORT %temp\MyHistory.txt /o outpath\outname.ext
LOG ON
I tried clearing the box, and then got a zero-length history file.Did you clear the "History File" box in the OPTION dialog ("Command Line" tab)? If you don't, TCC will have the last word.
I am not logging commands.Tom - are you LOGging every command? If so you can't modify a file the same time a utility is - like SORT ...
LOG OFF
history >! %temp\MyHistory.txt
SORT %temp\MyHistory.txt /o outpath\outname.ext
LOG ON
Hmmm! I've been using TCC (and it's predecessors) for over 20 years. I've never used a command history file and I've never seen one. I just looked very hard for one and I couldn't find one. Lets start over.I tried clearing the box, and then got a zero-length history file.
history |! sort /o (path\)history.txt
history /r (path\)history.txt
Hmmm! I've been using TCC (and it's predecessors) for over 20 years. I've never used a command history file and I've never seen one. I just looked very hard for one and I couldn't find one. Lets start over.
Clear the "history file" box. The only line in TCEXIT.BTM that refers to history should be something like (notice the change to use SORT's "/o" instead of redirection, because redirection can fail if you have NOCLOBBER set).
The only line in TCSTART.BTM that refers to history should be something likeCode:history |! sort /o (path\)history.txt
Code:history /r (path\)history.txt
I just tried this and it worked. When I exited and restarted TCC, I had a perfectly sorted history.
Note that if you ever get this working, you might hate it. My history is about 164,000 bytes and when I performed the experiment above, it took 1 second to save it in TCEXIT.BTM and 10 seconds (!) to load it in TCSTART.BTM.
history /n >"C:\Program Files\JPSoft\TCMD16x64\history.txt"
history |! sort > "C:\Program Files\JPSoft\TCMD16x64\history.txt"
"HISTORY /N" produces no output; it just removes duplicates in place ... in memory. Your 0-byte file (earlier) was probably coming from the first line above. You can prevent duplicates getting into the history in the first place by choosing (Duplicates) "Save first" or "Save last" in the OPTION dialog.... and TCEXIT contains the following:
Code:history /n >"C:\Program Files\JPSoft\TCMD16x64\history.txt" history |! sort > "C:\Program Files\JPSoft\TCMD16x64\history.txt"
cdd %shralias_save_path
for %c in ( history dirhistory alias function ) %c /r %c.sav
delay 3
shralias