4 ms·
> Can mktemp fail? Yes it can. You should use its exit status (or set -e). See http://man.openbsd.org/mktemp http://man.openbsd.org/mktemp Note that there i
by clarry 7y ago
> Can mktemp fail?
Yes it can. You should use its exit status (or set -e). See http://man.openbsd.org/mktemp http://man.openbsd.org/mktemp
Note that there is a nasty trap if you're using local to declare and set a variable:
a () { local M=`ls /asdf` && echo y; }
b () { N=`ls /asdf` && echo y; }
a ; b ;
One will print y, the other will not.
- bewuethr 7y agoShellcheck helpfully warns about declaring and assigning in the same statement exactly because it masks exit status.