I don't know the $((...)) syntax, but it could be from a more exotice shell and not recognised by the Bourne shell.
This should work (for integer arithmetic):
let total=e4-s4
From the syntax $((expression)) it looks like your script was probably written to take advantage of
specific features in the bash shell. As a result your shell script will not be very portable to
non-Linux/GNU systems unless bash is available on these systems.
Your script is fine. Can you let us know how you are running it? As in, is the script an executable and are you running as: ./test.sh? Or are you running the script as: sh test.sh?
My guess is that it is the latter. In that case, the first line (#!/bin/bash) does not matter, and you are running the script using /bin/sh - which does not support $(( )).
Suggest that you follow fpmurphy's suggestion or make the script executable and run as ./test.sh