To help with recovering history across restarts etc I would like to get some key data, like $TERM_SESSION_ID, stored in my command history. This would be preserved when the command response output in screen history is no longer available.
I have tried a number of ways and though the session text shows the TERM_SESSION_ID data it is not stored in the command history:
1014 26/12 22:28:28 echo $TERM_SESSION_ID
1015 26/12 22:44:58 `echo $TERM_SESSION_ID`
1016 26/12 22:45:35 echo ${TERM_SESSION_ID}
1017 26/12 22:45:50 echo `$TERM_SESSION_ID`
1018 26/12 22:46:05 echo `echo $TERM_SESSION_ID`
1019 26/12 22:49:28 echo ${TERM_SESSION_ID}
Although I saw on screen (and do not mind the error messages):
$ echo ${TERM_SESSION_ID}
w3t0p0:5554ACED-B4C5-4E5A-A7C2-F5215ED4F4D7
$ echo `$TERM_SESSION_ID`
-bash: w3t0p0:5554ACED-B4C5-4E5A-A7C2-F5215ED4F4D7: command not found
I do not think this is down to the "info commands" being non bash-valid commands since I get the same sort of results with
1026 26/12 23:08:24 test="ls"
1027 26/12 23:08:27 echo $test
1028 26/12 23:09:03 ${test}
saw output of ls
command here, but command recorded is ${test}
as typed
Can you tell me how I can get my command history to log/include the data from the shell variable?
For instance:
1029 26/12 23:10:05 ls
1030 26/12 23:10:06 session
w3t0p0:5554ACED-B4C5-4E5A-A7C2-F5215ED4F4D7