Re: coproc does not work with a lower case variable name

2021-11-14 Thread Dale R. Worley
g...@as.lan writes:
> Description:
>   coproc gives a syntax error if I try to use it with a lower case 
> variable name and a compound command:
>   bash: syntax error near unexpected token `}'
>   bash: syntax error near unexpected token `('
>
> Repeat-By:
>   coproc bc { bc; }
>   coproc bc (bc)

What happens if give the coproc a name that is *not* a command you're
using?

I suspect that "bc" is an alias, and given that you can omit the NAME of
a coproc, bash is expanding the first use of "bc" as an alias, because
it might be the first word of a simple command.

Dale



Re: coproc does not work with a lower case variable name

2021-11-12 Thread Chet Ramey

On 11/11/21 11:09 PM, g...@as.lan wrote:


Bash Version: 5.1
Patch Level: 8
Release Status: release

Description:
coproc gives a syntax error if I try to use it with a lower case 
variable name and a compound command:
bash: syntax error near unexpected token `}'
bash: syntax error near unexpected token `('


Repeat-By:
coproc bc { bc; }
coproc bc (bc)


I can't reproduce this. What does `type bc' produce?


--
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRUc...@case.eduhttp://tiswww.cwru.edu/~chet/



Re: coproc does not work with a lower case variable name

2021-11-12 Thread Alex fxmbsw7 Ratchev
never seen, and i never coproc uppercase
i suspect your bc is a half complex alias

On Fri, Nov 12, 2021, 15:29  wrote:

> Configuration Information [Automatically generated, do not change]:
> Machine: x86_64
> OS: linux-gnu
> Compiler: gcc
> Compilation CFLAGS: -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong
> -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection
> -Werror=return-type -flto=auto -g  -D_GNU_SOURCE -DRECYCLES_PIDS -Wall -g
> -Wuninitialized -Wextra -Wno-switch-enum -Wno-unused-variable
> -Wno-unused-parameter -Wno-parentheses -ftree-loop-linear -pipe
> -DBNC382214=0 -DIMPORT_FUNCTIONS_DEF=0
> uname output: Linux as.lan 5.14.14-1-default #1 SMP Thu Oct 21 05:05:03
> UTC 2021 (2b5383f) x86_64 x86_64 x86_64 GNU/Linux
> Machine Type: x86_64-suse-linux-gnu
>
> Bash Version: 5.1
> Patch Level: 8
> Release Status: release
>
> Description:
> coproc gives a syntax error if I try to use it with a lower case
> variable name and a compound command:
> bash: syntax error near unexpected token `}'
> bash: syntax error near unexpected token `('
>
>
> Repeat-By:
> coproc bc { bc; }
> coproc bc (bc)
>
>


coproc does not work with a lower case variable name

2021-11-12 Thread gd
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong 
-funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection 
-Werror=return-type -flto=auto -g  -D_GNU_SOURCE -DRECYCLES_PIDS -Wall -g 
-Wuninitialized -Wextra -Wno-switch-enum -Wno-unused-variable 
-Wno-unused-parameter -Wno-parentheses -ftree-loop-linear -pipe -DBNC382214=0 
-DIMPORT_FUNCTIONS_DEF=0 
uname output: Linux as.lan 5.14.14-1-default #1 SMP Thu Oct 21 05:05:03 UTC 
2021 (2b5383f) x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-suse-linux-gnu

Bash Version: 5.1
Patch Level: 8
Release Status: release

Description:
coproc gives a syntax error if I try to use it with a lower case 
variable name and a compound command:
bash: syntax error near unexpected token `}'
bash: syntax error near unexpected token `('


Repeat-By:
coproc bc { bc; }
coproc bc (bc)



coproc does not work with a lower case variable name

2021-11-12 Thread Grósz Dániel
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -
funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -
Werror=return-type -flto=auto -g  -D_GNU_SOURCE -DRECYCLES_PIDS -Wall -g -
Wuninitialized -Wextra -Wno-switch-enum -Wno-unused
uname output: Linux as.lan 5.14.14-1-default #1 SMP Thu Oct 21 05:05:03 UTC 
2021 (2b5383f) x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-suse-linux-gnu

Bash Version: 5.1
Patch Level: 8
Release Status: release

Description:
coproc gives a syntax error if I try to use it with a lower case 
variable name and a compound command:
bash: syntax error near unexpected token `}'
bash: syntax error near unexpected token `('


Repeat-By:
coproc bc { bc; }
coproc bc (bc)