bug-bash
[Top][All Lists]
Advanced

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

bash ignores $TMPDIR in heredoc and herestring


From: Matthias Steppuhn
Subject: bash ignores $TMPDIR in heredoc and herestring
Date: Wed, 18 Dec 2013 10:42:20 +0100


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 ....

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc -I/usr/src/packages/BUILD/bash-3.2
-L/usr/src/packages/BUILD/bash\
-3.2/../readline-5.2
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64'
-DCONF_OSTYPE='l\
inux-gnu' -DCONF_MACHTYPE='x86_64-suse-linux-gnu' -DCONF_VENDOR='suse'
-DLOCALE\
DIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H   -I.  -I.
-I.\
/include -I./lib   -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2
-fstack-pro\
tector -funwind-tables -fasynchronous-unwind-tables -g  -D_GNU_SOURCE
-DRECYCLE\
S_PIDS -Wall -g -std=gnu89 -Wextra -Wno-unprototyped-calls -Wno-switch-enum
-Wn\
o-unused-variable -Wno-unused-parameter -ftree-loop-linear -pipe
uname output: Linux sclvl040 2.6.32.12-0.7-default #1 SMP 2010-05-20
11:14:20 +\
0200 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-suse-linux-gnu

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 ...

Repeat-By:
        export TMPDIR='some full or write protected dir'
        echo " this should fail, case \$TMPDIR is honored"
        HEREDOCUMENT_PATH=$(sed -e 's/^/        HEREDOC temp=/g' <<<$TMPDIR)
        echo -e "calculating $HEREDOCUMENT_PATH requires temporary file(s) ,
as it is processed as a herestring / heredoc operation \n
        if TMPDIR $TMPDIR is honored, this should fail , else it uses /tmp
what simply  is wrong \n
        mktemp shows what should happen:"
        echo " proof with mktemp, which honors the variable"
        bash <<EOSCRIPT
        mktemp
        touch 1
        EOSCRIPT





best regards

Matthias Steppuhn
Customer Solutions III/ETL

QSC AG
Weidestraße 122b
22083 Hamburg

Telefon: +49 40 27136 8793
Mobil: +49 1520 9199463
E-Mail: matthias.steppuhn@qsc.de
Internet: www.qsc.de



(See attached file: Matthias_Steppuhn.vcf)


Sitz der Gesellschaft: Köln - Amtsgericht Köln HRB-Nummer 28281
Vorstand: Jürgen Hermann (Vorsitzender), Barbara Stolz, Stefan Freyer,
Henning Reinecke
Vorsitzender des Aufsichtsrats: Dr. Bernd Schlobohm

Besuchen Sie auch unser Blog unter http://blog.qsc.de

Attachment: Matthias_Steppuhn.vcf
Description: Binary data


reply via email to

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