Hello,

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)

Tests show that the result of the assignment is the result of the
pipeline started for command substition (here: the exit code of
"urldecode"). But is this something to depend upon, or is it
an implementation detail?

Alternatively the result of "var=$(cmdsubst)" could be the result
of the assignment, e.g. an error if the command substitution fails
(e.g. "out of processes").

Maybe the exit code is a combination: "0" if everything works
without error, different from zero if *anything* goes wrong, either
in the command substitution, during the assignment?

Heiner

--
 ___ _
/ __| |_ _____ _____ _ _     Heiner STEVEN <[email protected]>
\__ \  _/ -_) V / -_) ' \    Shell Script Programmers: visit
|___/\__\___|\_/\___|_||_|   http://www.shelldorado.com/
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to