Hi,
Is the format of the data file fixed?
if you can set the content of the data file i suggest you setup a script like so...
Code:
# myvarsscript
varone=one
vartwo=two
varthree=three
export varone vartwo varthree
When you want to load the variables do...
Code:
. myvarscript
if the format of the data file cannot be changed then the following is much less flexible but may suffice
Code:
varone=$(awk -F\| '{ print $1 }' datafile)
vartwo=$(awk -F\| '{ print $2 }' datafile)
varthree=$(awk -F\| '{ print $3 }' datafile)
varfour=$(awk -F\| '{ print $4 }' datafile)
varfive=$(awk -F\| '{ print $5 }' datafile)
If they're fixed variables that you commonly need I personally would just added them to my .bashrc
DW