Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: kill % fails?



On Sun, Nov 28, 2021 at 1:50 AM Dominik Vogt <dominik.vogt@xxxxxx> wrote:
>
> > Run with xtrace enabled?
>
> It prints the whole block inside the loop

Hmm.  I used
%  for i in {1000..1}; do /bin/sleep $i & sleep 0.01; kill %; done

and I get as the last two iterations

+Src/zsh:12> i=5
[997] 64582
+Src/zsh:12> /bin/sleep 5
+Src/zsh:12> sleep 0.01
+Src/zsh:12> kill %
+Src/zsh:12> i=4
[998] 64584
zsh: job table full
+Src/zsh:12> /bin/sleep 4

So that looks to me as though the background "/bin/sleep 4" fills the
table and the foreground sleep fails and kills the loop.  The loop is
%1 and the first background job is %2 ...




Messages sorted by: Reverse Date, Date, Thread, Author