Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #13753
| Path | csiph.com!feeder.erje.net!2.us.feeder.erje.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!bloom-beacon.mit.edu!bloom-beacon.mit.edu!171.64.64.130.MISMATCH!usenet.stanford.edu!not-for-mail |
|---|---|
| From | moosotc@gmail.com |
| Newsgroups | gnu.bash.bug |
| Subject | Re: Function definitions |
| Date | Mon, 26 Feb 2018 18:26:55 +0300 |
| Lines | 44 |
| Approved | bug-bash@gnu.org |
| Message-ID | <mailman.9755.1519658824.27995.bug-bash@gnu.org> (permalink) |
| References | <877er0qbb7.fsf@gmail.com> <CAPSX3sQAtEFOn5TUTEpr=Ja0UQVj7p0yr=N6sGA=uJFjafCrtQ@mail.gmail.com> |
| NNTP-Posting-Host | lists.gnu.org |
| Mime-Version | 1.0 |
| Content-Type | text/plain |
| X-Trace | usenet.stanford.edu 1519658825 739 208.118.235.17 (26 Feb 2018 15:27:05 GMT) |
| X-Complaints-To | action@cs.stanford.edu |
| Cc | "bug-bash\@gnu.org" <bug-bash@gnu.org> |
| To | Pierre Gaston <pierre.gaston@gmail.com> |
| Envelope-to | bug-bash@gnu.org |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=b/4Ytu29+iZqy90dc7gITGZ221QCs30BOIMU2ikMF0w=; b=R0kP71wwZPJBz6LC3vIME3We4CQpb6pTSb+d7kag0u/ATR742yIFCMCwBv46TN0fVG mAUfXBVPZXCilkAIhf2Oweovl3SYI/pC6EaMk0C2xf+Twn8ayy9M1diZ5e4JHW/235UP JZN/BoQ4nHaKHdcTlfNhz6SpwKoAY7l2ujHnITpwxj+MLpJU2vK2RTEG5ImmZlboXyKX /V5h6x/pA0TOZBilkqKuwuizjPgJULvzkU56PI7ynQ+5Snng1GheQkSMf0nEwR+/c6oo /+V6+LeBdmVCBt6OL89ZiqwzHzlA37WkFrUen55TKrSYHHugMo0t1FxKUrDGkCkbjAEm 1wCQ== |
| X-Google-DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=b/4Ytu29+iZqy90dc7gITGZ221QCs30BOIMU2ikMF0w=; b=YO1HrZaj3HHcB5Ju8qxdg9ynlM44mWTKEGbFuqpxdNvM9a8Ztl1rEDqpvnTWnA7NXt x7JJ3LdtlbAt3lXMcMHbTqytG8eoy4Gxtw2rxrSVK/U7aUUgLo0eguIvW6KZOBtWwBKa UdAqtzM0o/rTXOuk4MBl6NbYxkzliSPlKQIQILnlNOnGEvPfG47VKZiM+GzimP5n7gzR blbqtC1Cs1Rxl7VuOk2BfPIWpGLHo1+BNykJutqAYg8GF59plWLi7LCcpmRV3zTUkBI1 AyY3IjN4JyJXHdCdP6uVU93GCzez+0+cCpCykLWb0xQN8JHphNb4HyaPBsne2LHWeFRd Ftcg== |
| X-Gm-Message-State | APf1xPB0qFwCyaE5dfFGSOMAiALqHyJBoIo1NnGjvSNxLdeK2hB6UzGp 4ZmOFgD9Ynci+a/lhRMvEUuiAw== |
| X-Google-Smtp-Source | AG47ELvZUGIePZ1nQ5u3iy/O2TJgaraBbWEl/143H1V5p9AmnhxAem5V1F1FVqHeJ/i2Cn+cYknFxg== |
| X-Received | by 10.25.113.14 with SMTP id m14mr7768882lfc.71.1519658816436; Mon, 26 Feb 2018 07:26:56 -0800 (PST) |
| In-Reply-To | <CAPSX3sQAtEFOn5TUTEpr=Ja0UQVj7p0yr=N6sGA=uJFjafCrtQ@mail.gmail.com> (Pierre Gaston's message of "Mon, 26 Feb 2018 16:16:26 +0200") |
| User-Agent | Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
| X-detected-operating-system | by eggs.gnu.org: Genre and OS details not recognized. |
| X-Received-From | 2a00:1450:4010:c07::232 |
| X-BeenThere | bug-bash@gnu.org |
| X-Mailman-Version | 2.1.21 |
| Precedence | list |
| List-Id | Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org> |
| List-Unsubscribe | <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe> |
| List-Archive | <http://lists.gnu.org/archive/html/bug-bash/> |
| List-Post | <mailto:bug-bash@gnu.org> |
| List-Help | <mailto:bug-bash-request@gnu.org?subject=help> |
| List-Subscribe | <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe> |
| Xref | csiph.com gnu.bash.bug:13753 |
Show key headers only | View raw
Pierre Gaston <pierre.gaston@gmail.com> writes:
> On Mon, Feb 26, 2018 at 12:45 PM, <moosotc@gmail.com> wrote:
>
[..snip..]
>>
>> $ func() true
>> bash: syntax error near unexpected token `true'
>>
>> # Variant#2
>> $ func() { true }
>> > ^C
>>
>> Both forms seem to be valid per [1] and are accepted by (at least)
>> ash, zsh and mksh
>>
>> Worth noting that the Variant#2 can be made to work in bash with an
>> addition
>> of a semicolon:
>>
>> $ func() { true; }
>>
>> [1] http://pubs.opengroup.org/onlinepubs/9699919799/
>> utilities/V3_chap02.html
>>
>> --
>> mailto:moosotc@gmail.com
>>
>>
> On the contrary SUS doesn't define either one, as function definition
> requires a compound command
>
> http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_05
>
> and it requires a delimiter in compound commands
>
> http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_04
Thanks.
--
mailto:moosotc@gmail.com
Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread
Re: Function definitions moosotc@gmail.com - 2018-02-26 18:26 +0300
csiph-web