read built-in command has a problem in shell function

2021-10-10 Thread Hyunho Cho
Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -g -O2 -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wall uname output: Linux EliteBook 5.11.0-25-generic #27-Ubuntu SMP Fri Jul 9 23:06:29 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux Machine Type:

Re: Misleading error when attempting to run foreign executable

2021-10-10 Thread Dmitry Goncharov via Bug reports for the GNU Bourne Again SHell
On Sun, Oct 10, 2021 at 9:11 PM Eli Schwartz wrote: > So I wonder, if bash already in this exact case attempts to open() the > file and read() it to look for a shebang, what's the harm in assuming > (or checking) that it exists in this patch? i guess, you are right. i, on the other hand wonder, i

Re: Misleading error when attempting to run foreign executable

2021-10-10 Thread Eli Schwartz
On 10/10/21 20:24, Dmitry Goncharov via Bug reports for the GNU Bourne Again SHell wrote: > On Sun, Oct 10, 2021 at 7:52 PM Ángel wrote: >> Looking at the code, it doesn't even need an extra stat(), it already >> knows the file exists > > Attempts to know ahead of time or check afterwards that th

Re: Misleading error when attempting to run foreign executable

2021-10-10 Thread Dmitry Goncharov via Bug reports for the GNU Bourne Again SHell
On Sun, Oct 10, 2021 at 7:52 PM Ángel wrote: > Looking at the code, it doesn't even need an extra stat(), it already > knows the file exists Attempts to know ahead of time or check afterwards that the file exists are subject to a race condition. regards, Dmitry

Re: Misleading error when attempting to run foreign executable

2021-10-10 Thread Ángel
I agree with Ilkka and Alex: it would be helpful to show a different error message in this case. I know about ELF format and what leads to this, and it's still slightly confusing when faced to it. You have to double-check that the file is indeed there (not a mistyped command), and then locate the

Re: Incorrect LINENO with exported nested functions with loops

2021-10-10 Thread Chet Ramey
On 10/9/21 3:47 PM, Chet Ramey wrote: The FOR token is what causes the parser to increment word_top. The ARITH_FOR_EXPRS token parses just one part of that production (the ((...;...;...)) part). It's true that the function that parses the stuff between the double parens doesn't use word_lineno[w

Re: EXIT trap is not executed after an exec failure in a non-interactive shell

2021-10-10 Thread Alex fxmbsw7 Ratchev
any current standing point of 'ipc can not be done' alike whatsoever wont be standing for too long in any case, just a question of time On Sun, Oct 10, 2021 at 2:06 PM Alex fxmbsw7 Ratchev wrote: > > maybe the same way to implent here a fix may do IPC between bashes ? > a meta database of stuff u

Re: EXIT trap is not executed after an exec failure in a non-interactive shell

2021-10-10 Thread Alex fxmbsw7 Ratchev
maybe the same way to implent here a fix may do IPC between bashes ? a meta database of stuff used in scripts, then if exec reset meta'ly to none ( undo em maybe .. i have to figure such for my bashlinker project too ) and if that fails restore em back the same meta db can be used in IPC somehowly.