How do I redirect output from psftp command

itwex
itwex used Ask the Experts™
on
I created a file (contents below) via tsql stored procedure and ran it via ftp -s:

open server_ip
username
password
cd /itadmin/PostIngres/Billpay/
verbose off
ls EUWCC* D:\Integra\BILLPAY\WORKING\ftp_file_list.dat
quit

I need to do the same except using sftp so I downloaded putty sftp (called via psftp on command line) - however I can't redirect the out to a file on the server like in ftp  "ls EUWCC* D:\Integra\BILLPAY\WORKING\ftp_file_list.dat" and when I use ls or dir in psftp I get

drwxr-x--- 2 ftpadmin ftpadmin        0 May 17 13:31 .
drwxr-x--- 2 ftpadmin ftpadmin        0 May 15 10:11 ..
-rwxr-x--- 1 ftpadmin ftpadmin    21018 May 17 13:31 EUCO213110501.DAT
-rwxr-x--- 1 ftpadmin ftpadmin    11779 May 17 13:21 EUWEX.DAT
-rwxr-x--- 1 ftpadmin ftpadmin        0 May 15 11:43 This is wexccuser

instead of just the file names?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
If you need a log of what happened, see here.

If you need to control it "interactively" from your code, check out running PuTTY from the command like (same reference, just a different part of the docs).

Alternatively, there are other secure FTP tools, like GlubTech's, that allow CLI use as well as GUI use.

hth

Mike
Sudeep SharmaTechnical Designer

Commented:
>>>ls EUWCC* D:\Integra\BILLPAY\WORKING\ftp_file_list.dat

Try this instead:
ls -1 EUWCC* D:\Integra\BILLPAY\WORKING\ftp_file_list.dat
itwexIS Project Leader

Author

Commented:
No not looking for a log of what happened, ls-1 is not a valid command


What I'm trying to do is get a clean listing of the files and redirect this output to a file on the my server over psftp (or some other way of connecting via sftp).
itwexIS Project Leader

Author

Commented:
not quiet what I'm after but close

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial