Your message dated Sun, 7 Apr 2024 14:18:15 +0200
with message-id <[email protected]>
and subject line Re: Bug#499633: noclobber Error Message Inconsitancy
has caused the Debian Bug report #499633,
regarding noclobber Error Message Inconsitancy
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
499633: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=499633
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: bash
Version: 3.2-4
Severity: normal

In some cases, the noclobber option's error output substitutes a file
descriptor for a file name. Please compare the file name field in the
output of the following examples.

The file "bar" in the current directory exists.

Test A:
    Code:
        #!/bin/bash

        set -o noclobber
        true
        echo foo > bar

    Output:
        $ ./test 
        ./test: line 5: bar: cannot overwrite existing file

Test B:
    Code:
        #!/bin/bash

        set -o noclobber
        true | true
        echo foo > bar

    Output:
        harda@callisto:~$ ./test
        ./test: line 5: 1: cannot overwrite existing file

Test C:
    Code:
        #!/bin/bash

        set -o noclobber
        true | true
        echo foo 1> bar

    Output:
        $ ./test
        ./test: line 5: bar: cannot overwrite existing file

Note: Test B adds "| true" to the second statement; Test C adds "1" to
      the third statement.

Test D (interactive):
    $ set -o noclobber

    $ true ; echo foo > bar
    bash: bar: cannot overwrite existing file

    $ true | true ; echo foo > bar
    bash: 1: cannot overwrite existing file

    $ true | true ; echo foo 1> bar
    bash: 1: cannot overwrite existing file

    $ true | true ; echo foo 2> bar
    bash: 2: cannot overwrite existing file

Note: the change in the file descriptor changes the error message only
      in the interactive test.

All test cases are equivalent and should return the same error message.

Thanks,

-Dave
-- 
David A. Harding            Website:  http://dtrt.org/
1 (609) 997-0765              Email:  [email protected]
                        Jabber/XMPP:  [email protected]



--- End Message ---
--- Begin Message ---
Version: 5.0-6

On Sat, 20 Sep 2008 15:34:57 -0400 "David A. Harding" <[email protected]> wrote:
In some cases, the noclobber option's error output substitutes a file
descriptor for a file name. Please compare the file name field in the
output of the following examples.
    $ set -o noclobber

    $ true ; echo foo > bar
    bash: bar: cannot overwrite existing file

    $ true | true ; echo foo > bar
    bash: 1: cannot overwrite existing file

    $ true | true ; echo foo 1> bar
    bash: 1: cannot overwrite existing file

Hi,

this issue does not seem to affect version 5.0-6 and later of bash.

    $ cat <<EOF > /tmp/nc.sh
    #!/bin/bash
    set -o noclobber
    touch bar
    echo A; true ; echo foo > bar
    echo B; true | true; echo foo > bar
    echo C; true | true; echo foo 1> bar
    EOF
    $ chmod +x /tmp/nc.sh; /tmp/nc.sh
    A
    /tmp/nc.sh: line 5: bar: cannot overwrite existing file
    B
    /tmp/nc.sh: line 6: bar: cannot overwrite existing file
    C
    /tmp/nc.sh: line 7: bar: cannot overwrite existing file

--
Gioele Barabucci

--- End Message ---

Reply via email to