Austin Group Bug Tracker
2014-09-11 14:55:04 UTC
The following issue has been SUBMITTED.
======================================================================
http://austingroupbugs.net/view.php?id=876
======================================================================
Reported By: eblake
Assigned To:
======================================================================
Project: 1003.1(2013)/Issue7+TC1
Issue ID: 876
Category: Shell and Utilities
Type: Omission
Severity: Objection
Priority: normal
Status: New
Name: Eric Blake
Organization: Red Hat
User Reference: eblake.cat
Section: cat
Page Number: 2526
Line Number: 81474
Interp Status: ---
Final Accepted Text:
======================================================================
Date Submitted: 2014-09-11 14:55 UTC
Last Modified: 2014-09-11 14:55 UTC
======================================================================
Summary: allow implementations to fail on 'cat a >> a'
Description:
Several existing implementations of cat explicitly refuse to output to the
same file descriptor as any of its inputs, to avoid filling up the disk if
the file is non-empty:
Solaris:
$ cd /tmp/
$ touch a
$ /usr/bin/cat a >> a
cat: input/output files 'a' identical
GNU:
$ cd /tmp/
$ touch a
$ cat a >> a
cat: a: input file is output file
This behavior doesn't seem to be permitted by the standard, although it is
useful. The proposal here only fixes cat, although the group may decide to
make the allowance for same input/output rejection have wider scope.
Desired Action:
At line 81474 [XCU cat STDOUT], add a sentence:
If the standard output is a regular file, and is the same file as any of
the input file operands, the implementation may treat this as an error
without writing anything to the output file.
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
2014-09-11 14:55 eblake New Issue
2014-09-11 14:55 eblake Name => Eric Blake
2014-09-11 14:55 eblake Organization => Red Hat
2014-09-11 14:55 eblake User Reference => eblake.cat
2014-09-11 14:55 eblake Section => cat
2014-09-11 14:55 eblake Page Number => 2526
2014-09-11 14:55 eblake Line Number => 81474
2014-09-11 14:55 eblake Interp Status => ---
======================================================================
======================================================================
http://austingroupbugs.net/view.php?id=876
======================================================================
Reported By: eblake
Assigned To:
======================================================================
Project: 1003.1(2013)/Issue7+TC1
Issue ID: 876
Category: Shell and Utilities
Type: Omission
Severity: Objection
Priority: normal
Status: New
Name: Eric Blake
Organization: Red Hat
User Reference: eblake.cat
Section: cat
Page Number: 2526
Line Number: 81474
Interp Status: ---
Final Accepted Text:
======================================================================
Date Submitted: 2014-09-11 14:55 UTC
Last Modified: 2014-09-11 14:55 UTC
======================================================================
Summary: allow implementations to fail on 'cat a >> a'
Description:
Several existing implementations of cat explicitly refuse to output to the
same file descriptor as any of its inputs, to avoid filling up the disk if
the file is non-empty:
Solaris:
$ cd /tmp/
$ touch a
$ /usr/bin/cat a >> a
cat: input/output files 'a' identical
GNU:
$ cd /tmp/
$ touch a
$ cat a >> a
cat: a: input file is output file
This behavior doesn't seem to be permitted by the standard, although it is
useful. The proposal here only fixes cat, although the group may decide to
make the allowance for same input/output rejection have wider scope.
Desired Action:
At line 81474 [XCU cat STDOUT], add a sentence:
If the standard output is a regular file, and is the same file as any of
the input file operands, the implementation may treat this as an error
without writing anything to the output file.
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
2014-09-11 14:55 eblake New Issue
2014-09-11 14:55 eblake Name => Eric Blake
2014-09-11 14:55 eblake Organization => Red Hat
2014-09-11 14:55 eblake User Reference => eblake.cat
2014-09-11 14:55 eblake Section => cat
2014-09-11 14:55 eblake Page Number => 2526
2014-09-11 14:55 eblake Line Number => 81474
2014-09-11 14:55 eblake Interp Status => ---
======================================================================