"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:


Caution: As a special service "Fossies" has tried to format the requested manual source page into HTML format but links to other man pages may be missing or even erroneous. Alternatively you can here view or download the uninterpreted manual source code. A member file download can also be achieved by clicking within a package contents listing on the according byte size field. See also the latest Fossies "Diffs" side-by-side code changes report for "tempname.1": 1.2.3_vs_1.2.4.

TEMPNAME

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
HISTORY
COPYRIGHT

NAME

tempname − create a unique temporary file, directory, or unused filename for use by shell scripts

SYNOPSIS

tempname [−c(reate_not)] [−d dirname] [−h(elp)] [−n(o_random_portion)] [−q(uiet)] [−s suffix] [−w(ildcard)] [−v(erbose)] [−D(irectory)] filename_prefix

DESCRIPTION

tempname creates a unique temporary file, directory, or unused filename for use by shell scripts with permissions 0600 or 0700, as appropriate.

OPTIONS

−h

Print help and quit.

−c

Do not create a temporary file or directory, but only print the name. It becomes the responsibility of the user to create this file. Be warned. Using this option is unsafe.

−d

Specify the directory in which the temporary file will be created. If this option is not specified, the program will attempt to locate a writeable temporary directory in the following order: "$TMPDIR", "$TEMP", "$TMP", "/tmp", "/var/tmp", and ".". If no writeable directory can be found, the program will abort. Directories that contain one or more space characters will be skipped in this search.

−n

Return the filename with no random portion attached. Also, no file will be created as per the −c option. This is typically used to provide a string against which the script writer can grep or something like that.

−w

Return the filename with a wildcard pattern instead of a random portion. Also, no file will be created as per the −c option. This is typically used to provide a string against which the script writer can perform wildcard searches.

−D

Create a directory instead of a file. The directory will have permissions 0700. This option will override the −c option.

−s suffix

Attach the specified suffix to the filename.

−v

Verbose output. The program will complain about any search directories that it finds that are not writeable.

−q

Quiet output. The program will never complain about unwriteable directories, even when the user has specified an unwriteable directory using the −d option.

HISTORY

This utility was originally intended as an alternative to the tempfile program that is part of Debian’s "debianutils" package. The key reason for developing this new utility was the fact that some programs out there insist on particular extensions in the filenames. At the time tempname was written, the version of tempfile found in Debian did not provide filename extensions on the temporary files it created. Debian’s tempfile utility subsequently had the −−suffix option added, but tempname has been preserved because of the usefulness of some of the other options.

Another utility that provides similar functionality to the tempfile program is mktemp by Todd Miller, which inspired the −D option, though no code was actually copied from mktemp. And interestingly, GNU coreutils added a mktemp utility with version 6.10 in 2008.

The logic for safely creating a temporary file or directory was derived from the tempname routine in glibc-2.6.1 (and subsequent updated thereafter).

COPYRIGHT

Original tempname routine Copyright 1991-2020 Free Software Foundation, Inc. Derived tempname program Copyright (C) 2004-2021 by Brian Lindholm.

This program is free software; you can use it, redistribute it, and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.