I am trying to connect SFTP server I am getting error: Syntax error at line 5 : `<' is not matched. I am using ksh.
while [ $counter -gt 0 ]; do
sftp user@host <<-EOF
ls -ltr
EOF
counter=$(($counter-1))
done
But it works for below.
while [ $counter -gt 0 ]; do
sftp user@host
ls -ltr
EOF
counter=$(($counter-1))
done