Hi All
I am trying to run a script in linux wherein i have a command like this
grep ^prmAttunityUser= djpHewr2XFMAttunitySetup_ae1_tmp
djpHewr2XFMAttunitySetup_ae1_tmp is a temporary file in which the user value is stored but this command in the script returns me balnk value whereas it has a value.
Not understanding why is this command in the scipt returning a blank value. Can anyone please help me on this.
Thanks
Are you sure that you have a line that starts with prmAttunityUser
in the file djpHewr2XFMAttunitySetup_ae1_tmp
because testing here, that format works perfectly
The value does exists in the file.$prmAttunityUser=ais
$prmAttunityUser=ais =/= prmAttunityUser=ais
did you mean to grep for
grep ^\\\$prmAttunityUser= djpHewr2XFMAttunitySetup_ae1_tmp
The entire logic is this
for y in $params; do
for pf in $parfile; do
ret=`grep \^$y\= $pf`
if [ "$ret" != "" ]; then
prm=$ret
fi
done
if [ "$prm" == "" ]; then
echo "parameter not found ($y) for job ($x.$invocation_id)"
echo "Returning value 1"
return 1
exit
else
prmString[$cnt]="${prmString[$cnt]} -param $prm"
fi
done
HEre parfile contains a value like prmAttunityuser = ais but still it returns blank.