In trying to understand your script and what you're doing with it, here's what I did.
I created a 'foo.dat' file in my home directory ($HOME in env var). In this file, there's a simple line that has '
10:20:30:40' in it. I didn't know the format of your dat file but you said it was the first variable so here we go.
Then I created a global variable that was exported. Something to remember about exporting a variable from the command line is that it will only be available in that session unless you add it as an alias executed during your login or add it to the skeleton profile, etc...
$ /home/booyaka > export FOO=`cat $HOME/foo.dat | head -1 | awk -F: '{ print $1 }'`
$ /home/booyaka > echo $FOO
10
Or you could do something like this, just as an alternative:
$ /home/booyaka > export FOO=`cat $HOME/foo.dat | head -1 | cut -d: -f1`
$ /home/booyaka > echo $FOO
10
If you're trying to do something else, and I misinterpreted, my bad...