Changeset View
Changeset View
Standalone View
Standalone View
usr.bin/mktemp/mktemp.1
Show All 31 Lines | |||||
.Dt MKTEMP 1 | .Dt MKTEMP 1 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm mktemp | .Nm mktemp | ||||
.Nd make temporary file name (unique) | .Nd make temporary file name (unique) | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.Nm | .Nm | ||||
.Op Fl d | .Op Fl d | ||||
.Op Fl p Ar tmpdir | |||||
.Op Fl q | .Op Fl q | ||||
.Op Fl t Ar prefix | .Op Fl t Ar prefix | ||||
.Op Fl u | .Op Fl u | ||||
.Ar template ... | .Ar template ... | ||||
.Nm | .Nm | ||||
.Op Fl d | .Op Fl d | ||||
.Op Fl p Ar tmpdir | |||||
.Op Fl q | .Op Fl q | ||||
.Op Fl u | .Op Fl u | ||||
.Fl t Ar prefix | .Fl t Ar prefix | ||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||
The | The | ||||
.Nm | .Nm | ||||
utility takes each of the given file name templates and overwrites a | utility takes each of the given file name templates and overwrites a | ||||
portion of it to create a file name. | portion of it to create a file name. | ||||
Show All 32 Lines | |||||
.Fl t Ar prefix | .Fl t Ar prefix | ||||
option is given, | option is given, | ||||
.Nm | .Nm | ||||
will generate a template string based on the | will generate a template string based on the | ||||
.Ar prefix | .Ar prefix | ||||
and the | and the | ||||
.Ev TMPDIR | .Ev TMPDIR | ||||
environment variable if set. | environment variable if set. | ||||
The default location if | If the | ||||
.Fl p | |||||
option is set, then the given | |||||
.Ar tmpdir | |||||
will be used if the | |||||
.Ev TMPDIR | .Ev TMPDIR | ||||
is not set is | environment variable is not set. | ||||
.Pa /tmp . | Finally, | ||||
.Pa /tmp | |||||
will be used if neither | |||||
.Ev TMPDIR | |||||
or | |||||
.Fl p | |||||
are set and used. | |||||
Care should | Care should | ||||
be taken to ensure that it is appropriate to use an environment variable | be taken to ensure that it is appropriate to use an environment variable | ||||
potentially supplied by the user. | potentially supplied by the user. | ||||
.Pp | .Pp | ||||
If no arguments are passed or if only the | If no arguments are passed or if only the | ||||
.Fl d | .Fl d | ||||
flag is passed | flag is passed | ||||
.Nm | .Nm | ||||
Show All 23 Lines | |||||
reasons it is suggested that | reasons it is suggested that | ||||
.Nm | .Nm | ||||
be used instead. | be used instead. | ||||
.Sh OPTIONS | .Sh OPTIONS | ||||
The available options are as follows: | The available options are as follows: | ||||
.Bl -tag -width indent | .Bl -tag -width indent | ||||
.It Fl d , Fl -directory | .It Fl d , Fl -directory | ||||
Make a directory instead of a file. | Make a directory instead of a file. | ||||
.It Fl p Ar tmpdir , Fl -tmpdir Ns Oo = Ns Ar tmpdir Oc | |||||
Use | |||||
.Ar tmpdir | |||||
for the | |||||
.Fl t | |||||
flag if the | |||||
.Ev TMPDIR | |||||
environment variable is not set. | |||||
Additionally, any provided | |||||
.Ar template | |||||
arguments will be interpreted relative to the path specified as | |||||
.Ar tmpdir . | |||||
If | |||||
.Ar tmpdir | |||||
is either empty or omitted, then the | |||||
.Ev TMPDIR | |||||
environment variable will be used. | |||||
.It Fl q , Fl -quiet | .It Fl q , Fl -quiet | ||||
Fail silently if an error occurs. | Fail silently if an error occurs. | ||||
This is useful if | This is useful if | ||||
a script does not want error output to go to standard error. | a script does not want error output to go to standard error. | ||||
.It Fl t Ar prefix | .It Fl t Ar prefix | ||||
Generate a template (using the supplied | Generate a template (using the supplied | ||||
.Ar prefix | .Ar prefix | ||||
and | and | ||||
▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines |