First of all, thanks for all of the inputs and valueable advices.
I guess Jhwilliams is correct, something is messed with my shell on this server b/c the same script is working on another server. The only thing different is this server is Linux and the other one in Solaris. Rather than fixing the code, I think it's best for me to find out what's going with the shell on this server.
Any advices for me to find out what's going on with this server?