shell script help needed

Ack. If you are a shell guru, I could really use your help.

The problem is that my script is "reading in" a string (from an external file) that includes a variable. (ie: $ENERGY) I need that variable to then be "interpreted" properly, and not just displayed as a literal string value.

Here's what I have:
Code:
#!/usr/freeware/bin/bash

FILE_LIST=sccs_filelist.dat
export FILE_LIST

cat $FILE_LIST | while read DESTINATION
do

  echo $ENERGY
  echo $DESTINATION

done

exit
Here is the content of my "sccs_filelist.dat" file:
Code:
$ENERGY/lib/site/BCG/perllib/bill/
$ENERGY/lib/unbundling
And here is the output from the script:

/energy/lg4/energy
$ENERGY/lib/site/BCG/perllib/bill/
/energy/lg4/energy
$ENERGY/lib/unbundling
So I need the $ENERGY part of the output above to be "interpreted" with the actual value of the ENERGY variable. So the output I would like to have is this:
/energy/lg4/energy
/energy/lg4/energy/lib/site/BCG/perllib/bill/
/energy/lg4/energy
/energy/lg4/energy/lib/unbundling
Thanks!

 

 

 

 

Top