1 |
Neil Bothwick <neil@××××××××××.uk> wrote: |
2 |
|
3 |
> On Wed, 26 Sep 2007 10:14:58 +0200, Alexander Skwar wrote: |
4 |
> |
5 |
>> Back to tar: Why use "tar -j" in scripts, when "bzip2 | tar" |
6 |
>> does the same thing? I very much disagree that "tar -j" is |
7 |
>> the "better" option here; |
8 |
> |
9 |
> Either way requires that you first determine the type of compression used |
10 |
> before you can decide where to pipe tar's output, if at all. Whereas |
11 |
> something like "tar xf somefile" avoids the need to do" file somefile" |
12 |
> and parse the output first. |
13 |
|
14 |
Pardon? "tar xf somefile" doesn't do any compression at all. |
15 |
I don't get what you mean. |
16 |
|
17 |
>> in fact, I'd say that "bzip2 | tar" |
18 |
>> is the better option, as it works on a lot more systems than |
19 |
>> "tar -j" does. Heck, "tar -j" even does not work on all GNU |
20 |
>> tar implementations, as very old GNU tars don't have bzip2 |
21 |
>> support at all and -j wasn't always used for bzip2. |
22 |
> |
23 |
> If you don't know the details of the platform running your script, you |
24 |
> should of course stick to POSIX, which tar can do fine. |
25 |
|
26 |
No, GNU tar is not completely POSIX compliant. The files it creates |
27 |
don't completely comply to the standard. But that's another story. |
28 |
|
29 |
> But if your |
30 |
> script in running in an environment you control, why not make use of more |
31 |
> efficient methods? |
32 |
|
33 |
If there are more efficient methods: Maybe. But if the non standard |
34 |
options aren't more efficient, why use them at all? "tar -j" is a |
35 |
good example here: Internally, tar invokes the external "bzip2" |
36 |
command. So with "tar | bzip2" vs. "tar -j", both are equally |
37 |
efficient. |
38 |
|
39 |
Alexander Skwar |
40 |
|
41 |
-- |
42 |
gentoo-user@g.o mailing list |