bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: multi-threaded compiling


From: Mischa Baars
Subject: Re: multi-threaded compiling
Date: Tue, 12 Mar 2024 10:47:05 +0100

Got it!!!

bash -c 'set +m; seconds=5; for (( i=0;i<32;i++ )); do exit ${i} &
pid[${i}]=${!}; done; sleep ${seconds}; for (( i=0;i<32;i++ )); do wait
${pid[${i}]}; e=${?}; echo "$(printf %3u ${i}) pid ${pid[${i}]} exit ${e}";
done;'

One problem solved :) The problem was exactly the -n, and had nothing to do
with interactive / non-interactive shells. Thank you for helping! Now the
Makefile works just as good as the script.

I can now use at least Makefiles for the parallel compilation. Would be
nice if we got #3 in the script working as well. Because I'm still curious
how to do the job right.

Best regards,
Mischa.

On Mon, Mar 11, 2024 at 8:20 PM Chet Ramey <chet.ramey@case.edu> wrote:

> On 3/11/24 2:50 PM, Mischa Baars wrote:
> > Which sort of brings us back to the original question I suppose. Who does
> > that line of code function from a script and why does it fail from the
> > command line?
>
> Job control and when the shell notifies the user about job completion,
> most likely, two of the relevant things that differ between interactive
> and non-interactive shells.
>
> --
> ``The lyf so short, the craft so long to lerne.'' - Chaucer
>                  ``Ars longa, vita brevis'' - Hippocrates
> Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/
>
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]