IMHO - use of tmp files; in an owner directory or the global /tmp directory should be an acceptable process IF...
"$$" is used in the filename to isolate it from use by multiple processes doing the same thing. ...and... IF...
no username nor password information is stored there.
A question I have; however, is related to use of tmp files vs. variables. I was recently slapped around in email at work by a cohort reviewing some code I'd written that uses tmp files to parge svn merge output saved there to determine success or failure since 'die' wasn't sending data to stdout nor stderr apparently so could not be easily trapped and parsed.
Can anyone give a brief tutorial of better use of vars as opposed to tmp files for such things? I'd really appreciate that.