#1051423 Documentation for return command

Package:
dash
Source:
dash
Description:
POSIX-compliant shell
Submitter:
Daniel Carpenter
Date:
2023-09-07 16:21:04 UTC
Severity:
normal
#1051423#5
Date:
2023-09-07 16:18:51 UTC
From:
To:
Dear maintainer,

The dash manpage states:

     The syntax of the return command is

           return [exitstatus]

     It terminates the currently executing function.  Return is implemented
as a builtin command.

I can't find any reference to what happens when exitstatus is omitted. Bash
does this:

       return [n]
              Causes  a  function  to  stop  executing and return the value
specified by n to its
              caller.  If n is omitted, the return status is that of the
last command executed in
              the  function body.

Is it the same? Could a sentence be added to the manpage (or return could
be added to the builtins section, like exit)?

Kind regards,
Dan