[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bug: illegal function name?
From: |
Andrey Butirsky |
Subject: |
Re: bug: illegal function name? |
Date: |
Sun, 20 Jan 2019 21:46:40 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101 Thunderbird/65.0 |
I'm not quite understand what exactly is "intentional".
The problem is inconsistent behavior of unset '-f' flag for "normal" and
"not-normal" function names (I'm not considering conflicting with
variable names case).
This is just confusing and makes the scripts error-prone, IMO.
On 20.01.2019 21:26, Eduardo A. Bustamante López wrote:
> On Sun, Jan 20, 2019 at 06:26:43PM +0300, Andrey Butirsky wrote:
>> Andreas, I know it will work with the '-f' flag.
>> But for others function names, the '-f' unset flag is not required.
>> Moreover, it seem confronts with Open Group Base Specification.
>> So I consider it as a bug still.
>>
> It is intentional. If you want bash to run in POSIX mode, you should use the
> `POSIXLY_CORRECT' variable or the `--posix'
> flag.
>
> | dualbus@system76-pc:~$ POSIXLY_CORRECT=y bash -c 'function 1a() { :; }'
> | bash: `1a': not a valid identifier
>
> And as Andreas mentioned, in general you should use `unset -f' if you want to
> operate on functions. Otherwise you risk
> conflict with a variable name.
- bug: illegal function name?, Andrey Butirsky, 2019/01/20
- Re: bug: illegal function name?, Ilkka Virta, 2019/01/20
- Re: bug: illegal function name?, Chet Ramey, 2019/01/20
- Re: bug: illegal function name?, Eduardo A . Bustamante López, 2019/01/20
- Re: bug: illegal function name?,
Andrey Butirsky <=
- Re: bug: illegal function name?, Eduardo Bustamante, 2019/01/20
- Re: bug: illegal function name?, Andrey Butirsky, 2019/01/20
- Re: bug: illegal function name?, Eduardo Bustamante, 2019/01/20
- Re: bug: illegal function name?, Chet Ramey, 2019/01/20
- Re: bug: illegal function name?, Andrey Butirsky, 2019/01/20
- Re: bug: illegal function name?, Robert Elz, 2019/01/20
- Re: bug: illegal function name?, Eduardo A . Bustamante López, 2019/01/20
- Re: bug: illegal function name?, pepa65, 2019/01/21
- Re: bug: illegal function name?, Chet Ramey, 2019/01/21
- Re: bug: illegal function name?, Robert Elz, 2019/01/20