[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Can the exit status of the code block in @(...) be obtained from out
From: |
Hongyi Zhao |
Subject: |
Re: Can the exit status of the code block in @(...) be obtained from outside the @() structure? |
Date: |
Wed, 19 Jan 2022 19:47:32 +0800 |
On Wed, Jan 19, 2022 at 2:56 AM Paul Smith <psmith@gnu.org> wrote:
>
> On Tue, 2022-01-18 at 10:14 +0800, Hongyi Zhao wrote:
> > But it seems that the `$?' used above can't obtain the exit status of
> > the code block in @(...) when used from outside the @() structure
> > [2]. So, I want to know if I can reliably obtain the exit status of
> > the code block in @(...) from outside the @() structure. Any hints
> > will be greatly appreciated.
>
> First, of course you must use $$? not $?, because $? is a shell
> variable not a make variable so you must escape it from make.
>
> Second, there's nothing magical about ().
This reminds me of the following similar problems when using GNU
Makefile variable assignment as discussed here [1]:
VAL = foo
VARIABLE = $(VAL)
In the above usage, can I also change to the following?
VAL = foo
VARIABLE = $$VAL
[1]
https://programmer.help/blogs/gnu-makefile-variable-assignment-what-is-the-difference-between.html
Regards,
HZ
Re: Can the exit status of the code block in @(...) be obtained from outside the @() structure?, Hongyi Zhao, 2022/01/20
Re: Can the exit status of the code block in @(...) be obtained from outside the @() structure?, Paul Smith, 2022/01/21
Re: Can the exit status of the code block in @(...) be obtained from outside the @() structure?, Hongyi Zhao, 2022/01/21