On 2/28/21 9:56 PM, Dale R. Worley wrote:
What does not work:
function x ( : )
Check your Bash version. IIRC, recent versions (e.g. 5.1) have a minor
change in the Bison grammar (parse.y) for function definitions, IIRC
that I provided.
This is right; Dale sent the patch.
--
``The
On Sun, Feb 28, 2021 at 05:06:37PM -0500, Chet Ramey wrote:
> On 2/28/21 12:38 PM, Mike Jonkmans wrote:
>
> > The manual page says:
> > If the function reserved word is used, but the parentheses are not
> > supplied,
> > the braces are required.
>
> That text has been there since the ear
Mike Jonkmans writes:
> Some examples that work:
> function x { :; } ## as expected
> function x if :; then :; fi
> function x (( 42 ))
> function x [[ 42 ]]
> function x for x do :; done
> function x for (( ; 42 - 42 ; )); do :; done
>
> What does not work:
>
On 2/28/21 12:38 PM, Mike Jonkmans wrote:
The manual page says:
If the function reserved word is used, but the parentheses are not
supplied,
the braces are required.
That text has been there since the earliest versions of the man page. It's
not strictly true any more, but it's
28 Şubat 2021 Pazar tarihinde Mike Jonkmans yazdı:
> Hi,
>
> The manual page says:
> If the function reserved word is used, but the parentheses are not
> supplied,
> the braces are required.
>
> But it seems that from all the compound commands,
> only a subshell is not possible.
>
Mike Jonkmans (bash...@jonkmans.nl) wrote:
> What does not work:
> function x ( : )
The parser is looking for () after the function name. Most likely, the
opening ( is confusing it.
unicorn:~$ bash
unicorn:~$ x() ( : )
unicorn:~$ function y() ( : )
unicorn:~$ type x
x is a function
x ()
{
Hi,
The manual page says:
If the function reserved word is used, but the parentheses are not
supplied,
the braces are required.
But it seems that from all the compound commands,
only a subshell is not possible.
Some examples that work:
function x { :; } ## as expected