Heiner Steven a écrit :

how could I (in a reliable, portable way) retrieve the exit code of
the program "urldecode" in the following code fragment:

    var=$(echo "$url" | urldecode)

as already said, it's the return code of the last command whatever it is a pipeline or not.

however :

typeset var=$(...)

is different than :

typeset var=
var=$(...)

in the first case, the return code is the one of the typeset command and not the one of the var assignment. in other words, if the command fails in var assignment (i.e.: var=$(false)) the return code is still 0, since the var assignment is right (i.e.: var=something).
hope I have been enough clear.

Regards,

Cyrille Lefevre
--
mailto:[email protected]



_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to