1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

    Aug 28, 2010
    Likes Received:
    Trophy Points:
    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@ < commands
    and the "commands" files is
    d Root/md5* /
    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