"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 or download 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
    6 \fBtempname\fR
    7 [\fB\-c(reate_not)\fR]
    8 [\fB\-d\fR\~\fIdirname\fR]
    9 [\fB\-h(elp)\fR]
   10 [\fB\-n(o_random_portion)\fR]
   11 [\fB\-q(uiet)\fR]
   12 [\fB\-s\fR\~\fIsuffix\fR]
   13 [\fB\-w(ildcard)\fR]
   14 [\fB\-v(erbose)\fR]
   15 [\fB\-D(irectory)\fR]
   16 \fIfilename_prefix\fR
   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.
   21 .TP
   22 \fB\-h\fR
   23 Print help and quit.
   24 .TP
   25 \fB\-c\fR
   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.
   29 .TP
   30 \fB\-d\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.
   37 .TP
   38 \fB\-n\fR
   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.
   42 .TP
   43 \fB\-w\fR
   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.
   47 .TP
   48 \fB\-D\fR
   49 Create a directory instead of a file.  The directory will have permissions
   50 0700.  This option will override the \fB\-c\fR option.
   51 .TP
   52 \fB\-s\fR\~\fIsuffix\fR
   53 Attach the specified suffix to the filename.
   54 .TP
   55 \fB\-v\fR
   56 Verbose output.  The program will complain about any search directories that it
   57 finds that are not writeable.
   58 .TP
   59 \fB\-q\fR
   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
   62 option.
   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).
   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.