I just want to check whether following code will work or not. It is like a validation
su -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; fi
When 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.