Passing a var thru a file

afsipmh at cidsv01.cid.aes.doe.CA afsipmh at cidsv01.cid.aes.doe.CA
Wed Jun 19 01:32:22 AEST 1991


Say i have a file that (just for the sake of this question) contains
just one word:
$ENVAR

Say $ENVAR is an environmental variable

What is it about the shell that prevents interpretation:

#!/bin/sh
var=`cat file`
echo $var     #gives (literally) $ENVAR
echo `echo $var`  #also gives (literally) $ENVAR
-- 
Pat Hertel                 Canadian Meteorological Centre
Analyst/Programmer         2121 N. Service Rd.        
phertel at cmc.aes.doe.ca     Dorval,Quebec             
Environment Canada         CANADA           H9P1J3



More information about the Comp.unix.shell mailing list