GNU bug report logs - #15425
mktemp - conflicting options affected by ENV

Previous Next

Package: coreutils;

Reported by: Assaf Gordon <assafgordon <at> gmail.com>

Date: Fri, 20 Sep 2013 16:47:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Assaf Gordon <assafgordon <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: mktemp - conflicting options affected by ENV
Date: Fri, 20 Sep 2013 10:50:25 -0600
Hello,

Not sure if this is a bug or just unintended side-effect, but it caused some scripts here to fail and took a while to troubleshoot:
It basically boils down to the interplay between the deprecated "-t" "-p" and "$TMPDIR" and "--tmpdir".

===
##
## Problem 1: "-t" and TMPDIR (if non-empty) overrides "--tmpdir"
##
$ TMPDIR= mktemp -u --tmpdir=. -t XXXXXX
./og9G5s
$ TMPDIR=/foo/ mktemp -u --tmpdir=. -t XXXXXX
/foo/AAWcOl

##
## Problem 2: if TMPDIR is empty, "--tmpdir" overrides "-p", despite having "-t"
##
$ TMPDIR=/foo/ mktemp -u -p /bar/ --tmpdir=. -t XXXXXX
/foo/tHXcrq
$ TMPDIR= mktemp -u -p /bar/ --tmpdir=. -t XXXXXX
./OfWXSS
## I'd expect the above to use "/bar/OfWXSS", to be consistent with TMPDIR overriding "--tmpdir".
===

I realize "-t" and "-p" are deprecated, and it's best not to meddle with them -
but for consistency, perhaps consider having the new "--tmpdir" always take precedence over "-t" and "-p" ?
or print a warning to STDERR when "-t" and "--tmpdir" are mixed?

Regards,
 -gordon





This bug report was last modified 11 years and 227 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.