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 [url]ftp://test:test@[/url] < 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 !

6 Years
Discussion Span
Last Post by ausrasul

Interesting, Thanks for the help, I'll try it.
so far I found that the daemon closes all stdin stdout stderr before it makes the call to the shell script.
after openning the std I/O, it worked fine, on drawback is that I can see all the messages no the console screen.
I hope this will not be buffered after I log out from telnet.

Thanks for the help again !

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.