Link to home
Start Free TrialLog in
Avatar of Rita Byrne
Rita ByrneFlag for Ireland

asked on

How do I redirect output from psftp command

I created a file (contents below) via tsql stored procedure and ran it via ftp -s:

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

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?
Avatar of DcpKing
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Sudeep Sharma
>>>ls EUWCC* D:\Integra\BILLPAY\WORKING\ftp_file_list.dat

Try this instead:
ls -1 EUWCC* D:\Integra\BILLPAY\WORKING\ftp_file_list.dat
Avatar of Rita Byrne


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).
not quiet what I'm after but close