Sftp log

hi guy

i'd like to konw a method where can i save the output of sftp transation
For Exampl

sftp myuser@myip << EOF
ls -l Path
EOF

I want to save an a file "ls"
Thanks for all
Regards

ls is the name of a command, but OK.

sftp myuser@myip << EOF 2>&1 > ls
ls -l Path
EOF

First off never use a command name or special character like "ls", "rm", "sftp", "*" (UNIX commands, shell metacharacters) as the name of file. You will not believe the awful problems this can cause, and how hard it is to find and fix.

Use output redirection like this:

sftp myuser@myip << EOF  > mylogfile.log
ls -l Path
EOF

Scott beat me to it, but was nice about the ls filename problem.