Below code try to save a text block to file with bash but report error:
#!/bin/sh
cat > FILE.txt <<EOF
x=1024
x=$(($x/1024))
echo $x
EOF
Error message:
$ ./a.sh
./a.sh: 3: ./a.sh: arithmetic expression: expecting primary: "/1024"
What's proper way to fix such error?