I need to know the exit status of command that do assignment.
export VALUE=`My_Get_Value 10`
I need to know the exit status of My_Get_Value script.
In the $? I have the status of assignment itself.
I need it in KSH v93
I need to know the exit status of command that do assignment.
export VALUE=`My_Get_Value 10`
I need to know the exit status of My_Get_Value script.
In the $? I have the status of assignment itself.
I need it in KSH v93
export VALUE=$(My_Get_Value 10)
is not an assignment statement; it is a call to theexport
command, which takes arguments that look like assignment statements. The easiest fix is to separate the assignment from the call toexport
.It doesn't matter if you call
export
before or after the assignment (as long as you don't call it between the assignment and saving the value of$?
), sinceexport
sets an attribute on the nameVALUE
, not the value of the parameter namedVALUE
. The following is identical: