#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2004
    Posts
    20
    Rep Power
    0

    Unhappy Redirect SFTP Output


    Hi,

    I'm converting my FTP codes to SFTP for security reasons. I have a "dir sample.txt dir.log" command in FTP which redirects the output of "dir sample.txt" to "dir.log" so "dir.log" will contain the file info. of "sample.txt". I converted it to sftp and used the same command. dir.log was created but doesn't contain anything (0 bytes). It was coded using Expect (TCL). tried to redirect it using (>). still doesn't work. Hope you can help me with this. thanks!
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2010
    Posts
    1
    Rep Power
    0

    Redirect SFTP Output


    Hi,

    We need to convert below ftp code into sftp but we are unable to handle output redirection properly.

    FTP Code:

    ftp host1 < a.txt 2>&1

    where a.txt contains series of ftp commands:

    get run_dir/log/abc.log abc.log
    ls -l abc.label

    When we used the sftp instead of ftp, I could not redirect the output of ls -l command to abc.label file.

    Is there any known way to do that. Thanks in advance for your replies.

IMN logo majestic logo threadwatch logo seochat tools logo