"Fossies" - the Fresh Open Source Software Archive
Member "littleutils-1.2.4/littleutils/tempname.1" (28 Mar 2021, 3995 Bytes) of package /linux/privat/littleutils-1.2.4.tar.lz:
As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard
) with prefixed line numbers.
Alternatively you can here view
the uninterpreted source code file.
1 .TH TEMPNAME 1 "2021 Jan 15" littleutils
2 .SH NAME
3 tempname \- create a unique temporary file, directory, or unused filename for
4 use by shell scripts
5 .SH SYNOPSIS
17 .SH DESCRIPTION
18 \fBtempname\fR creates a unique temporary file, directory, or unused filename
19 for use by shell scripts with permissions 0600 or 0700, as appropriate.
20 .SH OPTIONS
23 Print help and quit.
26 Do not create a temporary file or directory, but only print the name. It
27 becomes the responsibility of the user to create this file. Be warned. Using
28 this option is \fIunsafe\fR.
31 Specify the directory in which the temporary file will be created. If this
32 option is not specified, the program will attempt to locate a writeable
33 temporary directory in the following order: "\fI$TMPDIR\fR", "\fI$TEMP\fR",
34 "\fI$TMP\fR", "\fI/tmp\fR", "\fI/var/tmp\fR", and "\fI.\fR". If no writeable
35 directory can be found, the program will abort. Directories that contain one
36 or more space characters will be skipped in this search.
39 Return the filename with no random portion attached. Also, no file will be
40 created as per the \fB\-c\fR option. This is typically used to provide a string
41 against which the script writer can \fBgrep\fR or something like that.
44 Return the filename with a wildcard pattern instead of a random portion. Also,
45 no file will be created as per the \fB\-c\fR option. This is typically used to
46 provide a string against which the script writer can perform wildcard searches.
49 Create a directory instead of a file. The directory will have permissions
50 0700. This option will override the \fB\-c\fR option.
53 Attach the specified suffix to the filename.
56 Verbose output. The program will complain about any search directories that it
57 finds that are not writeable.
60 Quiet output. The program will never complain about unwriteable directories,
61 even when the user has specified an unwriteable directory using the \fB\-d\fR
63 .SH HISTORY
64 This utility was originally intended as an alternative to the \fBtempfile\fR
65 program that is part of Debian's "debianutils" package. The key reason for
66 developing this new utility was the fact that some programs out there insist on
67 particular extensions in the filenames. At the time \fBtempname\fR was
68 written, the version of \fBtempfile\fR found in Debian did not provide filename
69 extensions on the temporary files it created. Debian's \fBtempfile\fR utility
70 subsequently had the \fB\-\-suffix\fR option added, but \fBtempname\fR has been
71 preserved because of the usefulness of some of the other options.
73 Another utility that provides similar functionality to the \fBtempfile\fR
74 program is \fBmktemp\fR by Todd Miller, which inspired the \fB\-D\fR option,
75 though no code was actually copied from \fBmktemp\fR. And interestingly,
76 GNU coreutils added a \fBmktemp\fR utility with version 6.10 in 2008.
78 The logic for safely creating a temporary file or directory was derived from
79 the \fItempname\fR routine in glibc-2.6.1 (and subsequent updated thereafter).
80 .SH COPYRIGHT
81 Original \fItempname\fR routine Copyright 1991-2020 Free Software Foundation,
82 Inc. Derived \fBtempname\fR program Copyright (C) 2004-2021 by Brian Lindholm.
84 This program is free software; you can use it, redistribute it, and/or modify
85 it under the terms of the GNU General Public License as published by the Free
86 Software Foundation; either version 3, or (at your option) any later version.
88 This program is distributed in the hope that it will be useful, but WITHOUT ANY
89 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
90 PARTICULAR PURPOSE. See the GNU General Public License for more details.