summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/coreutils.texi27
1 files changed, 23 insertions, 4 deletions
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 6126cf8cd..227014cd4 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -12068,12 +12068,12 @@ mktemp [@var{option}]@dots{} [@var{template}]
@end example
Safely create a temporary file or directory based on @var{template},
-and print its name. If given, @var{template} must end in at least
-three consecutive @samp{X}s. If omitted, the template
+and print its name. If given, @var{template} must include at least
+three consecutive @samp{X}s in the last component. If omitted, the template
@samp{tmp.XXXXXXXXXX} is used, and option @option{--tmpdir} is
-implied. The trailing @samp{X}s in the @var{template} will be replaced
+implied. The final run of @samp{X}s in the @var{template} will be replaced
by alpha-numeric characters; thus, on a case-sensitive file system,
-and with a @var{template} ending in @var{n} instances of @samp{X},
+and with a @var{template} including a run of @var{n} instances of @samp{X},
there are @samp{62**@var{n}} potential file names.
Older scripts used to create temporary files by simply joining the
@@ -12108,6 +12108,15 @@ file.H47c
@end example
@item
+Create a temporary file with a known suffix.
+@example
+$ mktemp --suffix=.txt file-XXXX
+file-H08W.txt
+$ mktemp file-XXXX-XXXX.txt
+file-XXXX-eI9L.txt
+@end example
+
+@item
Create a secure fifo relative to the user's choice of @env{TMPDIR},
but falling back to the current directory rather than @file{/tmp}.
Note that @command{mktemp} does not create fifos, but can create a
@@ -12186,6 +12195,16 @@ specified, @var{template} must not be absolute. However,
@var{template} can still contain slashes, although intermediate
directories must already exist.
+@item --suffix=@var{suffix}
+@opindex --suffix
+Append @var{suffix} to the @var{template}. @var{suffix} must not
+contain slash. If @option{--suffix} is specified, @var{template} must
+end in @samp{X}; if it is not specified, then an appropriate
+@option{--suffix} is inferred by finding the last @samp{X} in
+@var{template}. This option exists for use with the default
+@var{template} and for the creation of a @var{suffix} that starts with
+@samp{X}.
+
@item -t
@opindex -t
Treat @var{template} as a single file relative to the value of