Hi All , I want to use pipe in ftp session . Please let me know if there is any possibility
I have done FTP to a remote host with proper username and password
Now I want to take the latest file in a directory . The below is not workinf
ftp> ls -lrt | tail -1
please let me know how can i achieve the same
You can't. If your ftp even honors ls -lrt, it's giving you more than is required.
FTP is not shell. It is very simple and stupid.
Hi Corona,
Thanks for your reply . I understand the below command is not valid in FTP session
ftp> ls -lrt | tail -1
But is there any other way to find last updated file in a directory in remote host
Sure, you can do that outside ftp.
ftp <<EOF | tail -n 1
<commands to login>
ls -lrt
quit
EOF
This is assuming your FTP honors ls -lrt.