bug-bash
[Top][All Lists]
Advanced

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

close(63) after ENOEXEC


From: Harald Koenig
Subject: close(63) after ENOEXEC
Date: Wed, 11 Jun 2014 15:45:19 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-unknown-linux-gnu'
-DCONF_VENDOR='unknown' -DLOCALEDIR='/usr/local/share/locale'
-DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H   -I.  -I. -I./include
-I./lib   -g -O2
uname output: Linux foo 3.2.0-64-generic #97-Ubuntu SMP Wed Jun 4
22:04:21 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-unknown-linux-gnu

Bash Version: 4.3
Patch Level: 18
Release Status: release

Description:
        bash closes fd #63 for process subsitution when executing script
        without shebang line.
        I don't see why this might be a feature -- so I assume it's a bug;)

        this happens with bash-4.2.25(1) from Ubuntu 12.04 LTS,
        and the freshly built 4.3.18(1) (just to be sure it's not
fixed in the mean time...)

        Rationale:
        I want to run some scripts identically on both Linux and
Android with bash.
        but on android bash is installed in /system/bin/bash (vs.
/bin/bash on Linux) and I do not want
        to add some symlinks for "/system -> ." or similar, so I can't
use shebang to explicitly start bash...

        so far this seems to be the only bash feature which breaks
when using "#" instead of "#!/bin/bash"


Repeat-By:

cat > works.sh <<'EOF'
#!/bin/bash
ls -l /dev/fd/
cat $1
EOF

cat > breaks.sh <<'EOF'
#
ls -l /dev/fd/
cat $1
EOF

chmod +x works.sh breaks.sh

./works.sh  <( echo test works  )
./breaks.sh <( echo test breaks )



thanks for a fix (and not explaining why it might be a (anti-)feature;-),

Harald
-- 
"I hope to die                                      ___       _____
before I *have* to use Microsoft Word.",           0--,|    /OOOOOOO\
Donald E. Knuth, 02-Oct-2001 in Tuebingen.        <_/  /  /OOOOOOOOOOO\
                                                    \  \/OOOOOOOOOOOOOOO\
                                                      \ OOOOOOOOOOOOOOOOO|//
                                                       \/\/\/\/\/\/\/\/\/
Harald Koenig                                           //  /     \\  \
koenig@tat.physik.uni-tuebingen.de                     ^^^^^       ^^^^^



reply via email to

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