You should be able to exec anything although you won't have any environment variables, including a PATH, so you will need to use full paths
-rwxr-xr-x 1 robh staff    6947 Oct 25  2002 yourn.cgi
/nfs/nfs6/home/robh/cgi-pub
id
_=/usr/bin/env
uid=18396(robh) gid=1010(staff) groups=1010(staff),250(portage),500(sharks),501(burrow),502(extreme),506(webbers),1076(sysadmin),1432(facil),14110(cllqcal),59986(vboxusers)
This is an echo test
uid=18396(robh) gid=1010(staff) groups=1010(staff),250(portage),500(sharks),501(burrow),502(extreme),506(webbers),1076(sysadmin),1432(facil),14110(cllqcal),59986(vboxusers)