reopen 549179
thanks

> please read the answers in the following thread from the Austin ML:
> http://thread.gmane.org/gmane.linux.debian.devel.bugs.general/755640/focus=2959
> 
> There have been no more followups, so I believe that, when expecting
> a file, but given a directory, this is a user error which the shell
> needs not handle in a given way.

What user does, is of no consequence. What a shell should do, is better
looked up from the standard.

Reopening because the close message did not include explanation to the
points marked (>>), as to why mksh is interpreting them according to the
spec:

    See http://www.opengroup.org/onlinepubs/9699919799/utilities/sh.html
    hat defines:

    NAME
        sh - shell, the standard command language interpreter

    SYNOPSIS

    sh [-abCefhimnuvx][-o option][+abCefhimnuvx][+o option]
>>         [command_file [argument...]]

    INPUT FILES

>>      The input file shall be a text file, except that line lengths
        shall be unlimited. If the input file is empty or consists
        solely of blank lines or comments, or both, sh shall exit
        with a zero exit status.

    EXIT STATUS

    The following exit values shall be returned:
    0
>>      The script to be executed consisted solely of zero or more blank lines 
>> or comments, or both.
    1-125

        A non-interactive shell detected a syntax, redirection, or variable 
assignment error.
    127

>>      A specified command_file could not be found by a non-interactive shell.

That would summarize to something like; that a file is defined as being a:

    text file
    ====

Running conditions for the shell, when reading:

    script to be executed ...
    ======

and an error condition when:

    command_file could not be ...
    ============

The context of "file" in the sh specification is stated to be, not a
broad definition of term "file", but specifically limited to a "command
file" (sections: synopsis, exit status). According to the spec, if
"command file" is not to be found, it is an error condition. A non
command_file could be in this regard anything: a block device, a
character device, a directory.

For the reference, similar fix was committed to dash:

    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=548687

    Changes:
     dash (0.5.5.1-4) unstable; urgency=low
     *  Debian/diff/0025-INPUT-exit-127-if-command_file-is-given-...diff:
         new; exit 127 if command_file is given but is a directory (closes:
         #548687).


Jari



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to