In executing the following line in bash:
set -e
p=$(mktemp -t "${1}.$$.XX")
mktemp
fails with this message:
+++ mktemp -t cpfs.c.o.5643.XX
mktemp: too few X's in template `cpfs.c.o.5643.XX'
How can I have the error on fail include errors during command substitutions? Alternatively, how can I propagate the return code form mktemp back such that set -e
, or my own code can act on the result?