The rsh command cannot be redirected input. rsh can only execute commands on remote systems.
The sqlplus command given by reborg will work as the sqlplus can take input from the terminal.
Hi reborg ..
a similar code to mine doesnt work :
vzs422:/in/tmp>su - linus rsh -l linus psmf 'sqlplus -s <<EOF
> select * from tab;
> exit;
> EOF'
OSF1
OSF1
End of linus's profile.
ksh: sqlplus: not found