using FTP related commands in nawk utility in shell programming

I am facing problem while accesing FTP related commands in nawk code in bourne shell programming.I can able to connect to remote machine, but i can't able to get files from that machine.
Please help me in this.If you send code along with the solution, then it will be usefull for me.

Of course it would be useful to send the code!

Here's one way...not the only way as there are other remoter tools...but this was one I was forced to use to perform FTP functions within a script....

FTPid='your user'
FTPpwd='your password'
FTPserver='your destination server'
FINDstatement='find /export/home/ -mtime +29 -exec rm {} \\;'

(
sleep 2
echo ${FTPid}
sleep 2
echo ${FTPpwd}
sleep 2
echo ${FINDstatement}
sleep 5
exit
) | telnet ${FTPserver}

Obviously the FIND statement can be anything.......I am putting in the sleeps so that it has enought time to complete before doing to next step.

Hello

Thanks for gave the reply.But that is not my requirement.

let me to explain clearly what i am facing problem, probably i might not explain clearly first time. I have a file which will contain no. of records. Each record contain <filename> <filepath>. I have to read each record and get the filename which is there in filepath from the remote machine, this process has to be done  till to end of the file.It has to be done by using "nawk" in shell script. If you know pls help me in this and probably if you send code, then it will be usefull.

According to our rules:

And I must say that I suspect that this is an assignment of some kind. If I am wrong, why is nawk within a shell script a required aspect of the solution? Most people would be happy with any solution so long as it works. Requiring the use of a specific tool makes this look like homework.

At the risk of a "me too" reply ...

me too .. I agree.

There are much better tools to use than nawk for this type of script.

jiin