An excellent run down on Safely Creating And Using Temporary Files.
Tag Archives: mktemp
Creating a temp file in bash
47
To create a new temporary file in bash use the mktemp command. E.g.:
path="$(mktemp)"
There’s a -d argument to mktemp that will make a temp directory.