help-make
[Top][All Lists]
Advanced

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

Re: How to do arithmetic evaluation


From: Tim Magill
Subject: Re: How to do arithmetic evaluation
Date: Tue, 26 Sep 2000 10:49:49 -0700
User-agent: Mutt/1.2i

Be aware though, that if you do set the SHELL make variable, make will
use your shell for *all* commands, even if it might have directly
exec'd it otherwise.

tim


On Mon, Sep 25, 2000 at 12:44:42AM -0400, Paul D. Smith wrote:
> %% address@hidden writes:
> 
>   mc> Thanks for the help offered by Mr Paul D. Smith .  I have tried
>   mc> both "$(())" and "$$(())",but neither works.For example,the
>   mc> statement "echo $$((3+1))" will result in " +1c".I don't know if I
>   mc> should download gnumake again.
> 
> You should provide a complete example.
> 
> However, remember that make (all makes, including GNU make) invoke
> /bin/sh to execute commands.  It's quite likely that /bin/sh is a
> standard Bourne shell and doesn't provide complex operations like
> builtin arithmetic evaluation.
> 
> Either use expr (echo `expr 3 + 1`) or set the SHELL make variable to
> /bin/ksh or similar.
>
> -- 
> -------------------------------------------------------------------------------
>  Paul D. Smith <address@hidden>          Find some GNU make tips at:
>  http://www.gnu.org                      http://www.paulandlesley.org/gmake/
>  "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
> 
> _______________________________________________
> Help-make mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/help-make



reply via email to

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