[wplug] new HDD

Jonathan S. Billings billings at negate.org
Sat Feb 21 22:36:25 EST 2004


On Feb 21, 2004, at 10:18 PM, Brandon Kuczenski wrote:

>> | cd /home;
>> | tar cpf - . | ssh foobar.baz.com "cd /temp1; tar xpvf -"
>
> Can you explain what the '-' does there?  Is it a stand-in for a 
> temporary
> file?  That can't be, because how would the temporary file get to the
> remote system?

'-' is a magic metacharacter that stands for standard out or standard 
in, depending on whether you are reading from or writing to, 
respectively.  It's useful for the above situation, so you can copy a 
stream of data across an ssh session.

Here's another example:

enscript -p - mytext.txt | gv -

This makes enscript (which basically turns text in to postscript, 
useful for pretty-printing a text file) write to stdout, and then 
GhostView reads the stdin as a postscript file, and displays it.

jonathan




More information about the wplug mailing list