Gentoo Archives: gentoo-user

From: Steve Evans <stevee@××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] ssh and tar combined?
Date: Sat, 31 Dec 2005 15:03:28
Message-Id: 200512311455.34823.stevee@gorbag.com
In Reply to: Re: [gentoo-user] ssh and tar combined? by Neil Bothwick
1 On Saturday 31 December 2005 14:26, Neil Bothwick wrote:
2 > On Fri, 30 Dec 2005 18:58:17 +0100, Alexander Skwar wrote:
3 > > > tar outputs to stdout by default,
4 > >
5 > > Not always.
6 >
7 > From man tar
8 >
9 > -f, --file [HOSTNAME:]F
10 > use archive file or device F (default "-", meaning stdin/stdout)
11 >
12 > So "-f -" is unnecessary, but harmless.
13
14 That is true for GNU tar, but not for other versions, so specifying "-f -" is
15 the safest solution. For example the man page tar on Solaris 2.8 says:
16
17 f File. Use the tarfile argument as the name of the
18 tarfile. If f is specified, /etc/default/tar is not
19 searched. If f is omitted, tar will use the device
20 indicated by the TAPE environment variable, if set;
21 otherwise, it will use the default values defined in
22 /etc/default/tar. If the name of the tarfile is '-',
23 tar writes to the standard output or reads from the
24 standard input, whichever is appropriate. tar can be
25 used as the head or tail of a pipeline. tar can also
26 be used to move hierarchies with the command:
27
28 example% cd fromdir; tar cf - .| (cd todir; tar xfBp -)
29
30 The file /etc/default/tar contains a list of tape devices. So on Solaris 2.8
31 if -f is not specified and $TAPE is not set, which it isn't by default, then
32 tar will use a tape device *not* stdin/stdout
33
34 Steve
35 --
36 ____________________________________________________________________
37 Steve Evans E-mail: mailto:stevee@××××××.com
38 WEB: http://www.gorbag.com
39 Registered Linux user #217906: http://counter.li.org
40 Public Encryption Key: http://www.gorbag.com/public-key.html
41 ____________________________________________________________________
42
43 Now playing: Nina Simone - It might as well be spring
44
45 2.6.14-gentoo-r5 Intel(R) Pentium(R) 4 CPU 3.00GHz GNU/Linux
46
47 14:50:29 up 2 days, 21:41, 6 users, load average: 0.21, 0.14, 0.14
48
49 I didn't know he was dead; I thought he was British.

Replies

Subject Author
Re: [gentoo-user] ssh and tar combined? John Jolet <john@×××××.net>