Quote:
Code:
set -xv Again, without any further information it is a bit hard to recommend the best course of action. Consider posting a redacted version of your script. |
Quote:
So if you have a variable (at least one), you can check it (existence, content, whatever). If you have no any name to check you can still check the whole environment by adding a check function to your prompt. If you have a function which produces this strange thing you can put it into a subshell and it will not modify your current environment any more. |
Quote:
A potential solution appears to be in post 26, but with security concerns raised about logging sensitive data - except it doesn't appear to be necessary to log any variables (only to know when they are set). In which case, just have the logging system remove all known/expected environment variables and save a count of what remains (not the actual variables). Then it's a case of checking when the result doesn't contain zero and notifying in some way. Quote:
The OP is probably not understanding because they're still trying to find the cause, and isn't yet looking for a workaround to a problem that, once identified, may well have a real fix. |
Quote:
the functions i do have, which may have bugs, do some changes i need to have continue to work. so isolating them is not an option. determining which is the culprit is the intent. narrowing down which i was run when the odd changes happen is the goal. |
Quote:
all i am asking is how any script could do this. make up some small script and see if you can get that to be run every hour on your interactive shell, even when a long running program is running across that time. |
Quote:
|
Quote:
Quote:
I am not sure if you know this already or if it was mentioned before but you can edit Bash's history format (DISCLAIMER: I have not tried this) so you can know when you executed a certain command. Alternatively, if also you want to log the output of the commands you entered, you may want to try to use screen to record your interactive shell session: Code:
$ screen -L Setup your trap inside your new screen session and get its pid: Code:
$ trap envout SIGUSR2 Code:
$ kill -SIGUSR2 <pid> # <pid> from previous echo $$ Code:
$ export PS1="\$(date +%F_%T)$ " PS: Quote:
PPS (only if you go with screen): In case you run into problems, here is a useful link about environment variables in screen and the documentation for screen. The file screenlog.0 logs all your keystrokes, i.e., if you use the cursor keys they will be logged as well. Therefore the file's contents look like "gibberish". I have found the best way to look at screenlog.0 is to use Code:
$ more /home/<username>/env_monitor/screenlog.0 |
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
lots of useful help here, thanks much!! |
Quote:
Quote:
Quote:
Code:
$ mkdir /home/<username>/env_monitor/ # dedicated directory for (a lot of) logs Hope this helps. |
do we have now any progress (from the beginning?)
|
there is progress. i don't know if it's from the beginning.
Ubuntu seems to no longer have a package named "incrond". |
The package is named incron.
|
Quote:
Is the setting the PROMPT_COMMAND variable doing what you had in mind? |
> Is the setting the PROMPT_COMMAND variable doing what you had in mind?
i haven't gotten that far, yet. |
All times are GMT -5. The time now is 10:46 AM. |