logging into another server through script

Hello everybody,

I have one small issue... :frowning:

When i'm trying to connect another unix box through below script..

#!/usr/bin/bash
ssh $1 <<EOF
 
Commands 
.
.
 
 
exit
EOF

But getting some syntax error "-sh: syntax error at line 2: `end of file' unexpected". I used to use this login for many scripts, but not getting what's the issue here.
Can any experts help on this small issue please?

Thanks in advance..

Regards,
VRN

can u paste the code ur using. from what you are trying to say i am unable to guess anything.
just check onething. is ur EOF (the last EOF is at the start of the line or not)

try using expect.. Or Perl if you can use sockets in Perl.