Posted By

kevinberny on 12/23/08


Tagged

textmate Shell Bash


Versions (?)

Clean temp file create and cleanup


 / Published in: Other
 

  1. tf=/tmp/tf.$$
  2. cleanup() {
  3. rm -f $tf
  4. echo $tf "removed."
  5. }
  6. trap "cleanup" EXIT
  7.  
  8. touch $tf
  9. echo "$tf created"
  10. #temp file auto removed on exit or on quit

Report this snippet  

You need to login to post a comment.