Command mktemp

This command is part of the posix extensions and needs to be imported to be available to the shell.
See Posix Commands


mktemp create a temporary file or directory


mktemp [options]


-d,-directoryCreates a directory instead of a file
-s,-suffix suffixoptional suffix used for temporary file
-tempdir directoryUses directory instead of $TMP
-p,-prefix prefixoptional prefix used for temporary file


Creates a temporary file and outputs the full path name to stdout.
If -d is specified creates a directory instead of a file.
If -s is specified uses the supplied suffix otherwise no suffix is used.
If -p is specifies then prepends the supplied prefix otherwise "xmlsh" is used.

Note: an empty file is created not just a pathname. This is required to guarentee multiple calls to mktemp always return unique unused filenames.

Return Value

Returns 0 if the command executed successfully, 1 if there was an error.

There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki