The mktemp is useful for creating temporary files.

When creating scripts with mktemp, be mindful about the different implementations, specially if your intention is to run your script in a container.

The Alpine Linux (a very common distro in the Docker ecosystem) uses a simplified version of mktemp. Then, consider these caveats: