Using FTP with pipes
Pipe in Unix is a method of passing information from one command to another. The pipe take the output of the first command and sends it as input for the second command. The a second pipe can be used to grab the output of the second command and send it to the third command and so on. Pipe is a very powerful and useful feature of the Unix shell.
ftp> put "| tar cvf - ." myfile.tar
And to retrieve and untar, use:
ftp > get myfile.tar "| tar xvf -"
Or, to send and compress a tar file onto an ftp site, you can use this:
ftp> put "| tar cvf - . | gzip " myfile.tar.gz
Popularity: 3% [?]
No related posts.


