opensubscriber
   Find in this group all groups
 
Unknown more information…

h : help-gnu-utils@gnu.org 22 March 2010 • 12:54AM -0400

mktemp and suffixes
by Nuno J. Silva

REPLY TO AUTHOR
 
REPLY TO GROUP




In a BASH script I'm writing, I need temporary files. Unfortunately, not
only some of the used programs don't accept stdin nor stdout, but they
also require "extensions" on the input/output file.

As I want to be sure nothing is overwritten, I tried calling mktemp with
a modified template:

$ mktemp tmp.XXXXXXXXXX.ext
mktemp: too few X's in template `tmp.XXXXXXXXXX.ext'

Which is just the default template with some more characters appended,
that is, the amount of X's is the same. I even tried with more and more
X's and it still didn't work, so I gave up, as the problem must be
something else.

Is this a limitation of mktemp (X's must be on the right)? Or am I
missing some parameter? --suffix=.ext (seen on the web) doesn't work.

(And the version is 7.5:)

$ mktemp --version
mktemp (GNU coreutils) 7.5
Copyright (C) 2009 Free Software Foundation, Inc.
[...]

--
TIA,
Nuno J. Silva
gopher://sdf-eu.org/1/users/njsg




Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.