help-bash
[Top][All Lists]
Advanced

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

Re: Is there a way to capture all the exit status in an assignment?


From: Koichi Murase
Subject: Re: Is there a way to capture all the exit status in an assignment?
Date: Mon, 27 Apr 2020 02:20:28 +0900

2020-04-27 1:51 Marco Ippolito <address@hidden>:
> The suggestions using temp files with a fixed name feel a bit racy
> and brittle if two instances of the script run concurrently.

Yes, thank you for your comment. They were just simplified examples to
show ideas.  They are definitely racy and also has security problems
if used in an inappropriate way.  Therefore it should be used with
`mktemp' or something depending on the situation.  I just skipped such
details because it is not directly related to the current question.
Actually, I think there are still other problems in the examples if
they are used directly.  For example, the implementation of
`csubstatus' does not work with the case that the command specified
command contains `return', uses the variable names such as `__head',
or contains confusing strings such as `x="\$(escaped)"', etc.  So,
please use them only when you understand what you are doing.

--
Koichi



reply via email to

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