Removing created temp files in unexpected bash exit

前端 未结 8 1622
无人及你
无人及你 2021-01-29 21:44

I am creating temporary files from a bash script. I am deleting them at the end of the processing, but since the script is running for quite a long time, if I kill it or simply

8条回答
  •  一向
    一向 (楼主)
    2021-01-29 22:28

    You don't have to bother removing those tmp files created with mktemp. They will be deleted anyway later.

    Use mktemp if you can as it generates more unique files then '$$' prefix. And it looks like more cross platform way to create temp files then explicitly put them into /tmp.

提交回复
热议问题