I just want to check whether following code will work or not. It is like a validationsu -oracle ssh  oracle@$MY_IP -o 'BatchMode=yes' -o 'ConnectionAttempts=1'returnCode=$?echo $returnCode if [ $returnCode != 0 ] then  echo Configuration is not valid  return 1; else  echo Configuration is  valid  return 0; fiWhen I run my script, it just gives me empty prompt. I can not enter to if statement. it seems script is trying to connect MY_IP.How can I validate my statement without changing user and connecting to IP. 
how to check if ssh works without connecting to server
ssh
The only test to ensure that you can reach the other machine and log in there is to log in. Run a command that does nothing.su -c ssh  oracle@$MY_IP -o 'BatchMode=yes' -o 'ConnectionAttempts=1' true oracle