I bet your script has "#!/bin/sh" at the top. On the ubuntu system change it to "#!/bin/bash".
Ubuntu 8.04 and some earlier versions link /bin/sh to dash rather than bash, though bash is used for login and interactive shells. The ubuntu developers say that dash executes faster than bash and saves some time at bootup.
I ran into similar problems when I upgraded from ubuntu 6.06, which still used bash for everything, to 8.04, and it had me really confused for a while too.