I have a shell script which gets triggerred and runs at regular interval again and again on linux system, say every 45 mins. I need to share certain information between different runs of this shell script. What are different ways I can implement this? This is somewhat similar to interprocess communication. I dont want to use disk I/O so no file creation. Something I can create in memory and can keep it alive for some time duration e.g. 7AM to 12AM etc. During this time, the scripts runs say 20 times and uses/populates that data structure again and again. The values populated in previous run need to be used in next run by the script.
Basically I am looking for something which works like DB but faster and modifying that is less expensive operation. So I will keep my data in that DB like thing and all differnt runs of script will read/modify that thing instead of going to DB again and again. /dev/shm looks good option unless someone suggests better option.
echo $BASHPID; $(echo $BASHPID >/dev/shm/foo); cat /dev/shm/foo; rm -f /dev/shm/foo