On Fri, 9 Jan 2004, Markus Brueffer wrote:

MB>On Friday 09 January 2004 11:27, Robert Klein wrote:
MB>> On Freitag, 9. Januar 2004 10:33, Josef El-Rayes wrote:
MB>> > Lukas Ertl <[EMAIL PROTECTED]> wrote:
MB>> > > On Fri, 9 Jan 2004, Josef El-Rayes wrote:
MB>> > > > tar xvfj file.tar.bz2
MB>> > >
MB>> > > tar xvjf ....
MB>> >
MB>> > i do not think that the order of the parameters
MB>> > have any influence on the result.
MB>>
MB>> No, but the filename has to be right after the f.  The following
MB>> commands work, and both have the same result:
MB>>
MB>> tar -jxvf file.tar.bz2
MB>> tar -jxf file.tar.bz2 -v
MB>>
MB>> but the following does not work as you expect:
MB>>
MB>> tar -jxfv file.tar.bz2
MB>>
MB>> In this command tar(1) tries to extract the file "v".
MB>>
MB>> Example error message:
MB>> $ tar -jtfv xfce-4.0.1-src.tar.bz2
MB>> tar (child): v: Cannot open: No such file or directory
MB>> tar (child): Error is not recoverable: exiting now
MB>> tar: Child returned status 2
MB>> tar: xfce-4.0.1-src.tar.bz2: Not found in archive
MB>> tar: Error exit delayed from previous errors
MB>> $
MB>
MB>Remove the "-" from the front of the options-list and it will work in your
MB>last example. So Josefs statement was correct.
MB>
MB>What I'm asking me, is why the "-" makes a difference, though I haven't looked
MB>at the sources, yet. The manpage states, that the "-" is only optional, so
MB>"tar -jxfv" and "tar jxvf" should be equivalent, but obviously they are not.

Old tar (v7) and Posix (well, SUSv2) have no dash before the key (the
first argument to tar). They take option values from the next arguments in
the order the options appear in the key string:

tar xfbv file.tar 20000

x - no arg
f - take next arg (file.tar)
b - take next arg (20000)
v - no arg.

Using a dash is a gnu-ism and should be avoided in scripts.

harti
-- 
harti brandt,
http://www.fokus.fraunhofer.de/research/cc/cats/employees/hartmut.brandt/private
[EMAIL PROTECTED], [EMAIL PROTECTED]
_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to