On Saturday 31 December 2005 14:26, Neil Bothwick wrote: > On Fri, 30 Dec 2005 18:58:17 +0100, Alexander Skwar wrote: > > > tar outputs to stdout by default, > > > > Not always. > > From man tar > > -f, --file [HOSTNAME:]F > use archive file or device F (default "-", meaning stdin/stdout) > > So "-f -" is unnecessary, but harmless.
That is true for GNU tar, but not for other versions, so specifying "-f -" is
the safest solution. For example the man page tar on Solaris 2.8 says:
f File. Use the tarfile argument as the name of the
tarfile. If f is specified, /etc/default/tar is not
searched. If f is omitted, tar will use the device
indicated by the TAPE environment variable, if set;
otherwise, it will use the default values defined in
/etc/default/tar. If the name of the tarfile is '-',
tar writes to the standard output or reads from the
standard input, whichever is appropriate. tar can be
used as the head or tail of a pipeline. tar can also
be used to move hierarchies with the command:
example% cd fromdir; tar cf - .| (cd todir; tar xfBp -)
The file /etc/default/tar contains a list of tape devices. So on Solaris 2.8
if -f is not specified and $TAPE is not set, which it isn't by default, then
tar will use a tape device *not* stdin/stdout
Steve
--
____________________________________________________________________
Steve Evans E-mail: mailto:[EMAIL PROTECTED]
WEB: http://www.gorbag.com
Registered Linux user #217906: http://counter.li.org
Public Encryption Key: http://www.gorbag.com/public-key.html
____________________________________________________________________
Now playing: Nina Simone - It might as well be spring
2.6.14-gentoo-r5 Intel(R) Pentium(R) 4 CPU 3.00GHz GNU/Linux
14:50:29 up 2 days, 21:41, 6 users, load average: 0.21, 0.14, 0.14
I didn't know he was dead; I thought he was British.
pgpWwhGXl15ba.pgp
Description: PGP signature

