bug-bash
[Top][All Lists]
Advanced

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

Re: multi-threaded compiling


From: Martin D Kealey
Subject: Re: multi-threaded compiling
Date: Tue, 12 Mar 2024 18:32:19 +1000

In section one, the problem is that "wait -n" does not do what you think it
does. (Lots of us think this behaviour is broken, and it may be fixed in an
upcoming version of Bash.) You don't need '-n' when you specify a PID; the
fix is simply to remove it.

In section two, the problem is that quote removal is done BEFORE variables
are expanded, even though it prevents word splitting from being done AFTER
variable expansion. Therefore writing VAR=" \"string 1\" \"string 2\" "
absolutely cannot do what you might expect; the embedded quote marks will
be used literally, and then (because ${CFLAGS[0]} is not quoted) the
resulting string will be split on any embedded whitespace..


On Mon, 11 Mar 2024 at 18:56, Mischa Baars <mjbaars1977.backup@gmail.com>
wrote:

> Hi,
>
> I'd like to compile a project of mine using multiple logical cores.
>
> I've attached the problem. It consists of two parts:
>
> 1) multi-threaded bash script and / or multi-threaded Makefile
>
> Running bash script functions as expected, but executing the same line of
> code with make and / or the command line, does not function. Perhaps
> someone could explain to me why?
>
> 2) passing a string argument from a bash script and / or Makefile to the
> gcc -D option
>
> Running the makefile functions as expected, but I have not been able to get
> similar code to work from a bash script. Can someone please explain to me
> what I'm doing wrong?
>
> Hope to hear from you soon.
>
> Best regards,
> Mischa Baars.
>


reply via email to

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