The tar command allows you to use the "-" as shorthand for standard in (stdin) or standard out (stdout) depending on whether you are using it for input or output.
People commonly use this for creating a "tar pipeline".
A good example of this usage is found at this link:
http://www.linux.com/articles/54053
Quote:
The second main use of tar is in copying data around. If I need to move whole directories with good performance while preserving all permissions and attributes, I use a two-stage tar pipeline:
tar cflp - .|(cd $dest;tar xfp)
This creates a tar archive and sends it to stdout. The second stage creates a subshell that moves to the destination directory and extracts the archive from stdin. This same principle can be used over the network as well. This is immensely useful for creating backups of directories when making major changes, or copying data to a more accessible location to manipulate it.
|
You could adapt this pipeline usage for your purposes.