This is the Sage script that I currently am using from a Unix terminal window on my Mac to run the commands in the file tst.sage . You will need to change the location of the Sage executable in the alias below.
#!/bin/sh
#
alias sage='/Users/yates/jhy/sage/sage-2.8.15-osx10.5-intel-i386-Darwin/sage'
sage <<EOF
load "tst.sage"
exit
EOF
#