Mktemp
Jump to navigation
Jump to search
Internal
Overview
mktemp
takes file name templates and overwrites portions to generate a unique file name, creates the empty file with 0600 permissions (only the current users can read and write) and displays the file name at stdout. If no template is given, a unique file name appropriate to the system will be generated. On Mac, mktemp
creates something similar to /var/folders/t3/mmn20npx7fs31lwlp2s4_6wm0000gq/T/tmp.hbvowAQL
.
Create a uniquely named temporary file or directory and display its name at stdout.
local f
f=$(mktemp) || exit 1
Who's responsibility is to delete it? It is deleted automatically?
Options
-d
Create a temporary directory instead of a file.
mktemp -d