nk412 / optparse

Simple command line arguments parser for BASH
MIT License
158 stars 32 forks source link

Missing cleanup of temporary file #3

Closed dol closed 11 years ago

dol commented 11 years ago

The files under /tmp/optparse-${RANDOM}.tmp are not cleaned up. Use 'bash' traps to do the cleanup: http://stackoverflow.com/questions/687014/removing-created-temp-files-in-unexpected-bash-exit/687033#687033

nk412 commented 11 years ago

The temporary file will have to be deleted by the main script, not by optparse.bash ( using traps or not ). Since the parent function expects the file to be present to source it, it will lead to unpleasant race conditions if it is being deleted on exit.

On Mon, Sep 16, 2013 at 9:44 AM, Dominic notifications@github.com wrote:

The files under /tmp/optparse-${RANDOM}.tmp are not cleaned up. Use 'bash' traps to do the cleanup: http://stackoverflow.com/questions/687014/removing-created-temp-files-in-unexpected-bash-exit/687033#687033

— Reply to this email directly or view it on GitHubhttps://github.com/nk412/optparse/issues/3 .

Regards, Nagarjuna