I am on unix serverA where i have a script called A.sh
more A.sh
echo "Hello"
ssh user1@serverB
echo "Welcome"
After the ssh takes me to serverB; i execute a script on serverB called B.sh
more B.sh
echo " You are serverB"
exit
exit
With the two exit statements on serverB i was expecting that the control would comeback to serverA and that i would exit from serverB. But that did not happen and i had to manually type exit twice to come back to serverA where it then printed Welcome
Which is quite normal as of the little content of b.sh ... int other words it exited on the first exit as we would suppose it should have done and second is never executed...
After the script A.sh of serverA helps me ssh to ServerB; i manually execute the script on serverB i.e. ./B.sh . What do i have to code inside the B.sh so that it helps exit from serverB back to A.sh on serverA