syntax error near unexpected token `(' in shell script
<p>This is my script.</p>

<pre><code>#!/bin/bash
MONITOR=$(free -m| grep Mem)
MEM_TOTAL=$(echo $MONITOR | awk '{ print $2 }')
MEM_USED=$(echo $MONITOR | awk '{ print $3 }')
MEM_FREE=$(echo $MONITOR | awk '{ print $4 }')
MEM_CACHE=$(echo $MONITOR | awk '{ print $5 }')
MEM_BUFFER=$(echo $MONITOR | awk '{ print $6 }')
declare -i MEM_UTIL=($MEM_TOTAL-($MEM_FREE+$MEM_BUFFER+$MEM_CACHE))
echo "$MEM_UTIL"
</code></pre>

<p>I got syntax errors such as</p>

<pre><code>./memory_shell.sh: line 15: syntax error near unexpected token `('
./memory_shell.sh: line 15: `declare -i MEM_UTIL=($MEM_TOTAL-($MEM_FREE+$MEM_BUFFER+$MEM_CACHE))'
</code></pre>

<p>How can I fix it. I have 0 knowledge in shell scripting</p>