Assigning output from awk to variable

I have a script whose contents are as below

        result= awk 's=100 END  {print  s }' 
        echo "The result is" $result

The desired output is

    The result is 100

My script is running without exiting and i am also not getting the desired output.
Please help

where is the input to your awk ? and what are you trying to achieve. If all you want is to assign value to variable you can do it directly right . whats the point in using awk ?

I have a MyFile.xml whose contents are as below

<root>
    <Main>
            <someothertag>..</someothertag>
        <Amt Ccy="EUR">13</Amt>
    </Main>
                .
                .
                .
                some other tags
    <Main>
          <someothertag>..</someothertag>
             <Amt Ccy="SGD">10</Amt>
    </Main>
    <another>
      <Amt Ccy="EUR">10</Amt>
     </another>
</root>

I have script file whose contents are as below

result = `awk '/<Main>/ { f=1 } f && /Amt/ { split($0,a,/[<>]/); s+=a[3] } /<\/Main>/ { f=0 } END {print  s }' MyFile.xml`
echo "The result is " $result

But i am getting output as

result: 0653-690 Cannot open =.
result: 0653-690 Cannot open 23.
The result is

My Expected output is

The result is 23

I guess you opened two threads already for the same issue , and this is the third one.

result=$(awk 'BEGIN {s=100;print s}')
echo "The result is" $result

The result is 100
result=$(awk -F"[<>]" '/EUR/ {a+=$3} END {print a}' MyFile.xml)
echo "The result is " $result

No need to assign value to an variable.

echo -n "The result is "
awk -F"[<>]" '/EUR/ {a+=$3} END {print a}' MyFile.xml