sqlplus is waiting for your input - I'd imagine your command is just hanging. Look at the tnsping utility. (You should have it if you have sqlplus). It should do what you want. Also, there's no reason to redirect output here. System will store the return code, that's all you need.