Hi.
There's a number of things wrong here.
1) No need for the -1 - ls always outputs in single column mode when it's not outputting to a tty
2) Yes, you're right. The echo will just echo 'ls -1 download/$user' into sftp.
3) Just echoing a bunch of file names into sftp won't do anything. You'll need a 'put' or a 'get' command in front.
If I were doing this, I'd do:
Code:
ls | sed 's/^/\"/' | sed 's/$/\"/' | sed 's/^/put /' | sftp ......
The first two sed invocations wrap each file name in quotes, in case there's spaces in the filenames. The third sed add 'put ' to the start of the line.
Dave