Setting a permanent global variable in unix accessible from any script

Is there anyway in which i can set a permanent global variable in unix, which when initialised with a value and modified during any shell script, would retain its value even if i logout and login

I dont know whether i am being able to express my need clearly but basically what i want is a variable that can be accessed from one script,it may be incremented decremented etc and that the variable would hold its modified value even if i logout and then login and execute the script again

For example if i have a variable x initialised to 10, then if i do x=`expr $x + 1` in one script and then logout and login again, the value of x should be 11

Short answer: no
Long answer: not without a lot of hassle and without guarantees. It might be possible by having the shells logout script (if supported) write the value to a file, which is then read by the login script. BUT you'd have to deal with race conditions, and changes done in a non-login non-interactive subshell (eg. when running a script) would not be picked up without adapting that script first to support these extras.

thanks a lot mate

yes

your global variable is what ever is current in /tmp/myDumpfile.txt
just read it. it may change but if it's in a fixed location the information can either be read by others or given to others.
sample read from file;

#!/bin/sh

echo " READ FROM FILE - LOOP "
while read f
do
echo ""
echo " Doing something cool"
/usr/local/sbin/myshizz.sh
echo " TEST RESULTS for "$f

done < somedata.txt