Reading a variable from parameter file

HI all,

I have a parameter file with entries like

$$Name =Abhinav
$$CUTOFF_DATE = 11/11/2209

I am reading a variable from this file using a awk command like :

var2=`awk -F"[=]" "/CUTOFF_DATE/{f=$1;}{print f;}" InputFIleName`

but facing an error like

awk: cmd. line:1: /CUTOFF_DATE/{f=;}{print f;}
awk: cmd. line:1: ^ parse error
:

Please help

---------- Post updated at 11:33 AM ---------- Previous update was at 11:24 AM ----------

on changing line to

var2=`awk -F"[=]" "/CUTOFF_DATE/{print $1;}" Gdmp_Interface.prm`

i get complete line $$CUTOFF_DATE = 11/11/2209
as output

hello buddy,
your delimiter should be " = " and not "=" (note the spaces)
so your one liner comes close to
var2=`awk -F"[ = ]" '/CUTOFF_DATE/{f=$1;}{print f;}' InputFIleName`
here $1=CUT_OFF_DATE
and $2=11/11/2209
assuming you want to print the value then s/$1/$2 in the above one liner

what exactly do you mean by shell sites?

You have to use single quotes otherwise $1 gets interpreted by the shell. E.g.

var2="$(awk -F'[= ]*' '/CUTOFF_DATE/{print $2}' InputFIleName)"

---------- Post updated at 00:56 ---------- Previous update was at 00:15 ----------

How about:

while IFS='= ' read var param; do
 eval ${var#\$\$}=\"$param\"
done<InputFIleName
$> echo $Name
Abhinav
$> echo $CUTOFF_DATE
11/11/2209