help-make
[Top][All Lists]
Advanced

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

RE: How to echo the output of a shell command and preserve the newlines


From: Cook, Malcolm
Subject: RE: How to echo the output of a shell command and preserve the newlines
Date: Tue, 25 Aug 2015 18:35:50 +0000

> On Tue, 2015-08-25 at 10:40 -0700, Ploppz wrote:
 > > Ah, thanks! I was a bit confused in what degree I can rely on
 > > bash/shell functionality in make. Is the body of rules just plain sh
 > > or something else?
 > 
 > All recipes are passed to /bin/sh (not bash, unless you set the SHELL 
 > variable
 > explicitly in your makefile) [*].  Make just starts the shell, gives it the 
 > recipe,
 > and waits to see what the exit code is.

Keep in mind when the recipe is multiple lines and you are using parallelism 
(-j) then each line may be executed in different shells potentially out of 
order, unless you have as a target

.ONESHELL:

in which case the whole recipe will be sent to a single shell

 > 
 > 
 > [*] Actually if your recipe is "simple enough" make will invoke it directly
 > rather than starting a shell, for efficiency, but the results should be 
 > identical.
 > 
 > 
 > _______________________________________________
 > Help-make mailing list
 > address@hidden
 > https://lists.gnu.org/mailman/listinfo/help-make



reply via email to

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