How to? Shralias and producing history.sav, alias.sav ..

rps

Jul 6, 2008
436
6
If I load shralias and define shralias_save_path in the TCstart.btm file, with global history, aliases, dirhistory, and functions.
Then unload shralias; history.sav, alias.sav, function.sav and dirhistory.sav are not updated.

In the same TCC sesson, if I reload shralias from the command line and then unload it, the ".sav" files are updated.

The way I understand the help docs, these .sav files should be updated after unloading shralias for the first time.

I see the same behavior in both v23 and v24 BETA.

Is this a bug or maybe I don't understand the documentation?
 
May 20, 2008
11,543
104
Syracuse, NY, USA
In what order are you doing things (and is it all done in TCSTART)? TCC will start SHRALIAS.EXE and SHRALIAS.EXE needs SHRALIAS_SAVE_PATH in its own environment. So SHRALIAS_SAVE_PATH needs to be set before the SHRALIAS command
 

rps

Jul 6, 2008
436
6
In what order are you doing things (and is it all done in TCSTART)? TCC will start SHRALIAS.EXE and SHRALIAS.EXE needs SHRALIAS_SAVE_PATH in its own environment. So SHRALIAS_SAVE_PATH needs to be set before the SHRALIAS command

Yep. SHRALIAS_SAVE_PATH is defined waaaayyy before shralias is loaded, all done in TCSTART.btm.
So, are you actually getting .sav file updates with that order?
I must have missed this is the docs?

Perhaps things happen to fast during the execution of tcstart.btm, which would be very unfortunate.
 
May 20, 2008
11,543
104
Syracuse, NY, USA
Is this in a transient TCC (perhaps a logon script)? If so, there should be a delay after issuing SHRALIAS and before TCC terminates. Without such a delay, TCC can terminate, closing the memory-mapped global files before SHRALIAS.EXE has grabbed onto them. If SHRALIAS.EXE doesn't find any lists to protect, it will gracefully terminate. Do you have a way of checking whether SHRALIAS.EXE is actually running and whether SHRALIAS_SAVE_PATH is actually set in SHRALIAS.EXE?
 

rps

Jul 6, 2008
436
6
Is this in a transient TCC (perhaps a logon script)? If so, there should be a delay after issuing SHRALIAS and before TCC terminates. Without such a delay, TCC can terminate, closing the memory-mapped global files before SHRALIAS.EXE has grabbed onto them. If SHRALIAS.EXE doesn't find any lists to protect, it will gracefully terminate. Do you have a way of checking whether SHRALIAS.EXE is actually running and whether SHRALIAS_SAVE_PATH is actually set in SHRALIAS.EXE?
No, these are not transient TCC's.
Even though shralias_save_path is defined at the very beginning of my tcstart.btm, I added a "defer shralias" to my tcstart.btm.
After the TCC tab displayed a prompt, I unloaded shralias and as if by magic the .sav files were updated.
So, this issue is clearly all about timing.

Bottom line, setting up things so they will automatically update the .sav files isn't worth it to me.
I am unwilling to give up a very fast TCMD/TCC startup for this little bit of automation which I can't get to work as expected.
In future, I will deal with this manually.
 
May 20, 2008
11,543
104
Syracuse, NY, USA
I use a Windows login script (a BTM shortcut in the startup folder). It only needs to be done once. And I never unload shralias. It automatically dumps the files upon logout or shutdown

set SHRALIAS_SAVE_PATH=h:\ShrDump
cdd %SHRALIAS_SAVE_PATH
do c in /L history dirhistory alias function ( %c /r %c.sav )
delay 3
shralias
:: also start PowerPro, TclockEx, and Outlook
 

rps

Jul 6, 2008
436
6
I use a Windows login script (a BTM shortcut in the startup folder). It only needs to be done once. And I never unload shralias. It automatically dumps the files upon logout or shutdown

set SHRALIAS_SAVE_PATH=h:\ShrDump
cdd %SHRALIAS_SAVE_PATH
do c in /L history dirhistory alias function ( %c /r %c.sav )
delay 3
shralias
:: also start PowerPro, TclockEx, and Outlook
Very good idea.
Way back, perhaps in single digit versions, I had something in my startup folder, but it didn't prove itself as having any value.
Your idea has merit. I may give it a try.
Thanks.
 
Similar threads
Thread starter Title Forum Replies Date
E Fixed SHRALIAS doesn't work / SHRALIAS.EXE is missing in v20.11.35 Support 2
Mike Applebee SHRALIAS crashes on startup Support 2
Jay Sage Version 17 Installer Leaves Multiple Copies of ShrAlias Support 48
R SHRALIAS and command history Support 11
I shralias causes svchost.exe to use 100% cpu Support 10
vefatica Strange behavior reloading SHRALIAS sav files. Support 1
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
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

Similar threads