How to redirect stdin for child process (Linux Shell scripting)

Discussion in 'Shell Script' started by ausrasul, Aug 28, 2010.

  1. ausrasul

    ausrasul New Member

    Joined:
    Aug 28, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi,
    I'm trying to write a shell script that do ftp and download file periodically, this script should be called by a daemon running in the background.

    the shell script "script.sh" is as follows:
    yafc ftp://test:test@192.168.1.225:21 < commands
    and the "commands" files is
    d Root/md5* /
    quit
    if I run script.sh it will work just fine.
    But when the daemon software calls the "script.sh", the script will send ftp login request to the ftp server, but will not even answer the username or anything.

    I believe it is something about child process redirection, but I don't know how to deal with it.

    This problem is not only with yafc, it is the same with any ftp client or any application like telnet and so.

    can you help?
    Thanks !
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice