Masato Taruishi <[EMAIL PROTECTED]> writes:

[...]

>> $ TAPE=/dev/nst0 tar -x -O dummy -f -
>> tar: /dev/nst0: Cannot open: No such file or directory
>> tar: Error is not recoverable: exiting now

[...]

>> $ TAPE=/dev/nst0 tar -x -f - -O dummy
>> ... Waiting for input

[...]

> Isn't it the bug of tar?

Single Unix Standard specifies that option parsing should stops at
the first non-option.  So tar seems to be correct.  Here is the
according section:

Utility Syntax Guidelines

...
Guideline  9:
    All options should precede operands on the command line.

(Taken from http://www.opengroup.org/onlinepubs/007908799/xbd/utilconv.html#usg)
>
>>From 
>  ~$ info tar:
>
>  You must specify the source archives using `--file=ARCHIVE-NAME'
> (`-f ARCHIVE-NAME') (*note file::).  If you do not specify the target
> archive, `tar' uses the value of the environment variable `TAPE', or,
> if this has not been set, the default archive name.
>
> ....
>
> If you do not name the archive, `tar' uses the value of the
> environment variable `TAPE' as the file name for the archive.  If that
> is not available, `tar' uses a default, compiled-in archive name,
> usually that for tape unit zero (ie. `/dev/tu00').  `tar' always needs
> an archive name.

The problem is not that tar uses the contents of the TAPE
environment.  

The "-f -" option is specified in the tar call but in
the wrong order, behind the file name parameter.  Therefore, it is
interpreted as additional filenames ("-f" and "-") to extract and tar
falls back to its default archive name.

If the TAPE environment variable is unset the problem is hidden
because the debian package of tar uses stdin as default archive name.

        Torsten


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to