Solaris bash syntax different from Linux?

I have a script that's meant to check the disk usage on a particular volume and delete the oldest logfile if it's over a certain percentage. It runs fine on a Linux machine, but on a Solaris one, I get this error:
diskspace_check.sh: syntax error at line 3: `diskspace=$' unexpected

I assume this is due to some difference in syntax between the two systems, but I don't know what. Can anyone give me an idea?

Here is the whole script:

#!/bin/sh
logfile_path='log'
diskspace=$( df -h | grep '/c0t0d0s5' | awk '{ print $5 }' )
usep=$(echo $diskspace | cut -d'%' -f1  )
if [ $usep -ge 10 ]; then
  del_file=$( ls -lt $logfile_path | grep -E 'cisco.log' | tail -1 | awk '{ print $8 }' )
  del_path=$( echo $logfile_path"/"$del_file )
  rm $del_path
  echo "Removed log file $del_file from /disk2 on $(date)" |
   mail -s "Alert: Log file removed from /disk2" xxxxxx@yyyyy.com
fi

Solaris usually doesn't even have bash, you're using /bin/sh. This, by sheer coincidence, may happen to be bash on your linux system, but often means a much more restrictive shell anywhere else. Whenever you use bash-specific features, you should have the script call #!/bin/bash instead of #!/bin/sh to warn people.

Solaris in particular has a very stone-age /bin/sh.

I think it's objecting to the $(command) syntax, try backticks like `command` instead. You could also try using the Korn shell, /bin/ksh, which I think should be able to tolerate this script but differs from BASH in a few ways.

Try the XPG4-compliant shell i.e. /usr/xpg4/bin/sh. It supports the $(...) syntax.