The question is
how can I make the tee command work from "here documents"
What I wanted to do is to do some bash code which does like this
ftp to a server,
download a certain file a certain number of times, so that I can get the average throughput)
put the output from FTP (so that I can parse the lines that tells me about the throughput and do something)
and quit. Things work perfectly if I don't use the tee command as shown at the bottom, but without the tee command,
#parameter 1 is the file name that I want to copy
#parameter 2 is the number of times I want to get the file
for i in $(seq 2 $count)
ftp server | tee ftp.out
<<EOF #I have .netrc file, so I need no login, and here is where things go wrong
$(echo -e $command)
but the tee seems not to work, and I get the error "No Control connection for command: Broken pipe" and "No control connection for command: Illegal seek"
so how can I make the tee work?
Also, instead of just get file_name, I wanted to put another command say, get the file n times, so I did something like this
I also thought of first making the commands into a script file and make a macdef out of it in my .netrc file, but as I described in the question that I have asked in the coulumn before (and unfortunatley, no answer found http://www.experts-exchange.com/Programming/Programming_Platforms/Linux_Programming/Q_20742506.html
), my macdefs with .netrc don't work. and as far as I could see, there is no option in the linux ftp command (from the man pages), to give a command list to it. (like the s:scriptfile option in window)