May be posting a link is not appropriate so I cut/paste it here
I bumped into this problem regarding bash completion, can't find reference
to it.
When doing
$ echo foo "bar" /tm
I got /tm expanded to /tmp/ that is indeed correct.
But if I do
$ echo foo "bar
more bar" /tm
No completion is don
Hello!
I ran into something that looks like a bug to me, although I'm not super
familiar curly-brace command groups.
Bash version: latest from GitHub mirror (commit ce23728: Bash-5.1 patch 7)
Minimal repro:
$ sleep 1 & { wait $!; } | cat
[1] 665454
bash: wait: pid 665454 is not a child
On Tue, Jun 22, 2021 at 02:42:40AM -0700, Martin Jambon wrote:
> I ran into something that looks like a bug to me, although I'm not super
> familiar curly-brace command groups.
>
> Bash version: latest from GitHub mirror (commit ce23728: Bash-5.1 patch 7)
>
> Minimal repro:
>
> $ sleep 1 & { w
On 6/22/21 5:42 AM, Martin Jambon wrote:
Hello!
I ran into something that looks like a bug to me, although I'm not super
familiar curly-brace command groups.
It's not the brace command; it's the pipeline.
Minimal repro:
$ sleep 1 & { wait $!; } | cat
[1] 665454
bash: wait: pid 665
Meanwhile you may use functions to setup your variables something along
those lines.
PW$ function first-index { echo $1; }
PW$ function last-index { shift $(($#-1)) ; echo $1; }
PW$ declare -a array=([5]="hello" [11]="world" [42]="here")
PW$ declare -i first_index=$(first-index ${!array[@]})
PW$
On 6/22/21 6:15 AM, Chet Ramey wrote:
On 6/22/21 5:42 AM, Martin Jambon wrote:
Hello!
I ran into something that looks like a bug to me, although I'm not
super familiar curly-brace command groups.
It's not the brace command; it's the pipeline.
Thank you! It's the $$ that confused me since I
On 6/22/21 4:31 AM, Greg Wooledge wrote:
On Tue, Jun 22, 2021 at 02:42:40AM -0700, Martin Jambon wrote:
I ran into something that looks like a bug to me, although I'm not super
familiar curly-brace command groups.
Bash version: latest from GitHub mirror (commit ce23728: Bash-5.1 patch 7)
Minim
On Tue, Jun 22, 2021 at 01:12:10PM -0700, Martin Jambon wrote:
> On 6/22/21 4:31 AM, Greg Wooledge wrote:
> > A pipeline creates two or more subshells, one for each command in the
> > pipeline. Therefore, your wait command is running in a different
> > process than the one which created the sleep
The latest devel branch push has a rewrite of parse_comsub() to recursively
call the parser (yyparse()). I was finally able to get all the state
working correctly, though it will probably only work with bison.
Please run it through any tests or scripts you have so we can shake out any
bugs early.
On 6/22/21 1:37 PM, Greg Wooledge wrote:
On Tue, Jun 22, 2021 at 01:12:10PM -0700, Martin Jambon wrote:
On 6/22/21 4:31 AM, Greg Wooledge wrote:
A pipeline creates two or more subshells, one for each command in the
pipeline. Therefore, your wait command is running in a different
process than t
On Tue, Jun 22, 2021, at 6:32 PM, Martin Jambon wrote:
> I would also mention pipelines here, since these are more commonly
> used than () subshells. I don't know if there are other ways of
> creating subshells. If that's all, I think it would be valuable
> to mention those two cases rather than
On 6/22/21 5:00 PM, Lawrence Velázquez wrote:
Maybe something like this would get the point across:
($$) Expands to the process ID of the shell. In a subshell,
it expands to the value that $$ has in the invoking shell.
It's better. However, the reader is still left wonder
On Tue, Jun 22, 2021, at 8:52 PM, Martin Jambon wrote:
> It's better. However, the reader is still left wondering what "the
> shell" is referring to in first sentence.
Subshells aside, I have a hard time believing that "the process ID
of the shell" confuses anybody in practice. Even POSIX doesn'
> It's not the brace command; it's the pipeline.
>
>> Minimal repro:
>>
>>$ sleep 1 & { wait $!; } | cat
>>[1] 665454
>>bash: wait: pid 665454 is not a child of this shell
Interestingly, this is almost trivial to clairfy:
$ sleep 5 & { wait $!; }
[1] 19069
[1]+ Done
On 6/22/21 6:11 PM, Lawrence Velázquez wrote:
On Tue, Jun 22, 2021, at 8:52 PM, Martin Jambon wrote:
It's better. However, the reader is still left wondering what "the
shell" is referring to in first sentence.
Subshells aside, I have a hard time believing that "the process ID
of the shell" con
On Tue, Jun 22, 2021 at 06:54:18PM -0700, Martin Jambon wrote:
> This is confirmed by this definition from posix:
>
> A subshell environment shall be created as a duplicate of the shell
> environment, except [...]
> In the posix definition, a subshell
> - is not necessarily implemented as a separ
16 matches
Mail list logo