My advice is " not to use svrmgrl and connect internal", since these commands are deprciated in Oracle9i, so use sqlplus which will make your script compatible to new Oracle version also.

If you are using Unix.
try
sqlplus < connect scott/tiger@instance
select * from dept;
EOF


Sanjay