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 ()
{
On Fri, Feb 26, 2021 at 12:41:44PM -0500, Chet Ramey wrote:
> On 2/26/21 11:22 AM, Mike Jonkmans wrote:
>
> > I don't think that f.i. precedence was taught.
> > Although you get that with arithmetic, which also has a grammar.
>
> It's not taught as such. Kids today are taught operator precedence,
On 2/26/21 11:22 AM, Mike Jonkmans wrote:
I don't think that f.i. precedence was taught.
Although you get that with arithmetic, which also has a grammar.
It's not taught as such. Kids today are taught operator precedence,
phrased as "order of operations": PEMDAS.
--
``The lyf so short, the cr
On Fri, Feb 26, 2021 at 02:54:07AM +0100, Ángel wrote:
> On 2021-02-26 at 00:45 +0100, Mike Jonkmans wrote:
> > On Thu, Feb 25, 2021 at 11:15:36PM +0100, Ángel wrote:
> >
> > Those grammars weren't all that different from yacc's grammar.
> > Just simpler and incomplete.
> >
> > Minimal example:
>
On Thu, Feb 25, 2021 at 06:28:34PM -0500, Chet Ramey wrote:
> On 2/25/21 10:13 AM, Mike Jonkmans wrote:
> > Starting with 'Statements' might be an option.
>
> Maybe. Or a POSIX-like description that says a command can be a
>
> simple command
> list
> pipeline
> compound command
> function defini
On 2021-02-26 at 00:45 +0100, Mike Jonkmans wrote:
> On Thu, Feb 25, 2021 at 11:15:36PM +0100, Ángel wrote:
> > I really doubt so. I expect they would teach Dutch¹ grammar, but that's
> > quite different than formal grammars such as those of yacc.
> > Maybe you might use that in the teaching of a c
On Thu, Feb 25, 2021 at 11:15:36PM +0100, Ángel wrote:
> On 2021-02-25 at 16:13 +0100, Mike Jonkmans wrote:
> >
> > Aren't grammars taught already in primary school? It is in the
> > Netherlands.
> > But i agree that it is a good thing to let the text not depend on
> > that.
>
> I really doubt so
On 2/25/21 10:13 AM, Mike Jonkmans wrote:
Readers are likely to be familiar with simple commands and pipelines,
especially the ones who primarily use interactive shells. I disagree that
the average reader is likely to be familiar with grammars.
Aren't grammars taught already in primary school?
On 2021-02-25 at 16:13 +0100, Mike Jonkmans wrote:
> > Readers are likely to be familiar with simple commands and
> > pipelines, especially the ones who primarily use interactive
> > shells. I disagree that the average reader is likely to be familiar
> > with grammars.
>
> Aren't grammars taught a
On Wed, Feb 24, 2021 at 12:08:50PM -0500, Chet Ramey wrote:
> On 2/23/21 7:31 PM, Mike Jonkmans wrote:
> > On Tue, Feb 23, 2021 at 04:33:44PM -0500, Chet Ramey wrote:
> > > On 2/22/21 8:11 AM, Mike Jonkmans wrote:
> > > >
> > > > Hi,
> > > >
> > > > It seems some things are missing in the bash ma
On 2/23/21 7:31 PM, Mike Jonkmans wrote:
On Tue, Feb 23, 2021 at 04:33:44PM -0500, Chet Ramey wrote:
On 2/22/21 8:11 AM, Mike Jonkmans wrote:
Hi,
It seems some things are missing in the bash manual.
Notably definition of command and placements of coproc- and function-definition.
The section
On Tue, Feb 23, 2021 at 04:33:44PM -0500, Chet Ramey wrote:
> On 2/22/21 8:11 AM, Mike Jonkmans wrote:
> >
> > Hi,
> >
> > It seems some things are missing in the bash manual.
> > Notably definition of command and placements of coproc- and
> > function-definition.
> >
> > The section 'SHELL GRA
On 2/22/21 8:11 AM, Mike Jonkmans wrote:
Hi,
It seems some things are missing in the bash manual.
Notably definition of command and placements of coproc- and function-definition.
The section 'SHELL GRAMMAR' describes:
- simple-command
- pipeline
- list
- compound-command
- coproc
- function-de
18 matches
Mail list logo