I have tried using the export function to no avail. I have a function that
modifies $myvar each time TEXIS is invoked, but it seems to get initialized
to zero every time instead of assuming the exported value. Is there
something special you have to do to make exported variables work?
How do you maintain state of a variable across scripts that are not invoke through web , but scheduled to run after 5 mins.
Also I have a script, that I have made it to run in infinite loop i.e. while(true).
This is scheduled to run every 30 mins.
When invoked it reads runlog gets the pid of last run/current running script. If there is some script running it exits.
Now inside this script I invoke submethods as seperate processes using <switch>.
I wanna keep track of these subprocesses i.e. only max_process can run at a time.
Since ps -ef |grep "string" doesnot work uing <exec nobr... I decided to have a variables that hold the count at anytime.
When a subprocess finishes it subtracts one and when starts add one.
I want these variables exported/ available for each subprocess and only one suprocess can edit the value.
Continuing forward I let the subprocess sleep if the count exceeds.