Suppose I have a continuous process running that reads an environment variable:
export APPLE=abc123 watch echo \$APPLE
Now, is there any way to change the value that's being read during execution? I've tried suspending the process (ctrl-z), exporting a new value for the variable, then resuming (
fg), but the old value is still displayed.
Is this possible? I'd prefer an answer that works with basic command-line tools and doesn't require specialized software, though requiring root privileges is OK.