[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bash ignores $TMPDIR in heredoc and herestring

From: Chet Ramey
Subject: Re: bash ignores $TMPDIR in heredoc and herestring
Date: Wed, 18 Dec 2013 17:48:18 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.1.1

On 12/18/13 4:42 AM, Matthias Steppuhn wrote:
> Dear all,
> as I can't find a reference to a fix, I assume the glitch is still
> present ; I learned by accident, that bash utilizes tempfiles, even for
> herestrings and creates them in /tmp , ignoring any $TMPDIR setting.
> As a workaround for some strange application, I have to empty deleted files
> in /tmp - and sometimes /tmp is really filled , the script fails if it's
> needed most ....
> Bash Version: 3.2
> Patch Level: 51
> Release Status: release
> Description:
>         bash ignores $TMPDIR in heredoc and herestring , rendering my "/tmp
> jammed script" to fail , as soon as it is needed ...

Bash-3.2 used the system tmpdir (P_tmpdir from stdlib.h, otherwise a set of
common directories, each of which it requires to be writable) for here
strings and here documents.

Bash-4.0 and later use $TMPDIR but require that it name a writable
directory.  If it does not, it defaults to trying the same set of common
directories as bash-3.2.

The idea is that users do not need to know the implementation details of
here documents and here strings, so bash makes every effort to find a
usable directory for any temporary files it creates.

``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]