Otherwise a temporary file should be allocated; most shells have a means of allocating temporary files. And you'll get the variable as it existed at its final state - but only after the process finished.If this were more of a production scenario, the script should put some effort into cleanup of old files. One theoretical solution to what you originally wanted, on a synchronous, single threaded shell, would be to As I understand your requirements, you want to know for how long your script has been running.You will have difficulties with any website if you want a very small refreshing interval!Regarding "usually just run one instance of it" - we run several dozen instances of it to monitor remote servers.I was hoping that PRTG Network Monitor could be used to replace those graphs.PRTG Version 6 would do this so this is, unfortunately, another example where the "new" version of PRTG lacks some of the nice features of the old version.After looking for near an hour, I've come up with nothing, which is surprising, because it seems like someone would've wanted to do this before me. /bin/bash while true do SECONDSINSESSION=$SECONDS SECONDSINMINUTE=60 SECONDSINHOUR=3600 SECONDSINDAY=86400 DAYSINSESSION=$(expr "$SECONDSINSESSION" / "$SECONDSINDAY") DAY_REMAINDER=$(expr "$SECONDSINSESSION" % "$SECONDSINDAY") HOURSINSESSION=$(expr "$DAY_REMAINDER" / "$SECONDSINHOUR") HOUR_REMAINDER=$(expr "$DAY_REMAINDER" % "$SECONDSINHOUR") MINUTESINSESSION=$(expr "$HOUR_REMAINDER" / "$SECONDSINMINUTE") SECONDSINSESSION=$(expr "$HOUR_REMAINDER" % "$SECONDSINMINUTE") SESSIONLENGTH="$DAYSINSESSION days, $HOURSINSESSION hours, $MINUTESINSESSION minutes, and $SECONDSINSESSION seconds." sleep 1 done & ). It works because the shell variables are within the shell process.When run as a background process (or just invoked as a command), the script runs as a separate process, forked from the shell process.
As a simple test of this issue, I've created a GUI consisting of a single axes tagged 'plot Axes' and a togglebutton.When the togglebutton is "depressed", random data is continuously plotted in the axes using the code: With the 'gui_Singleton' parameter set to 0, I opened two instances of this GUI.If I toggle GUI A to start plotting, continuous random data is displayed in the axes.Is there any way to allow axes in separate GUI windows to update simultaneously?I tried using the 'batch' command to run the GUIs on separate workers, but the GUI does not display when started through 'batch' (I suspect 'batch' is not intended for anything graphics-related).
A couple of points on this: - In many ways 5 seconds is to long a time, especially for "perfmon" and certain network graphs.