Hi,
I believe you made a mistake on the sftp line. It should read:
sftp -n gom@hostname<<EOT >/dev/null 2&>1
...
EOT
You shouldn't use "<" or ">" as part of the label that delimits shell input.
"<<" tells the shell to take the following lines, up to a line that is
identical to the keyword that follows "<<", and give it as input to the
command preceding "<<" (in your case, sftp).
The rest of the line says to ignore (trash) the output of the command, which
may not be a good idea when you are debugging (just try "sftp -n
gom@hostname<<EOT" until you are done debugging).
Denis
> > I have achived the following:
> >
> > # !/bin/bash
> > sftp -n gom@hostname<<EOT> >/dev/null 2&>1
> > pass jt42 ??????????????
> > lcd /home/gom
> > put Datos
> > <EOT>
> >
> > I have to connect other 4 machines using sftp.
> > the line ??????? is wrong and of course the script doesn´t run and
> > doesn`t transfer this file.
> >
> > Thank´s for your helping