bug-bash
[Top][All Lists]
Advanced

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

Shell exits when piping to undeclared function


From: Maxim Vexler
Subject: Shell exits when piping to undeclared function
Date: Wed, 13 Apr 2005 03:14:32 +0300

From: Maxim Vexler
To: bug-bash@gnu.org
Subject: Shell exits when piping to undeclared function

Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: i686-pc-linux-gnu-gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i686'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu'
-DCONF_VENDOR='pc' -DSHELL -DHAVE_CONFIG_H  -I.  -I. -I./include
-I./lib  -march=athlon-xp -Os -pipe -fomit-frame-pointer
uname output: Linux HitSYNC 2.6.10-nitro2 #1 Thu Jan 6 12:22:15 IST
2005 i686 AMD Athlon(tm) XP 3200+ AuthenticAMD GNU/Linux
Machine Type: i686-pc-linux-gnu

Bash Version: 2.05b
Patch Level: 0
Release Status: release

Description:
        Bash behaves in an oddly fashion when trying to pipe to non
existing function.
        On some platforms it outputs a "setpgid" error while on others it
        invokes an builtin "exit" or "output" command.

        Other users reported this behavior reoccurs.
        On the following distributions:
        - Debian Testing
        - Denian Sarge
        - Gentoo
        1. exits with the "exit" builtin.

        On RH8
        1. bash: child setpgid (12740 to 12732): Operation not permitted

        On SUN
        1. bash: child setpgid (25730 to 25726): Not owner

        All the above with various kernel, bash and gcc versions.

        A discussion on this issue (in Hebrew) can be found at the
following url :
        http://whatsup.org.il/forum/22024

Repeat-By:

        : | :() { :; }

   shell dump:
        bash-2.05b$ echo $SHELL
        /bin/bash
        bash-2.05b$ echo $SHLVL
        3
        bash-2.05b$ $SHELL
        bash-2.05b$ echo $SHLVL
        4
        bash-2.05b$ ls -l | function foo() { echo "foo foo kaka"; }
        bash-2.05b$ exit
        bash-2.05b$ echo $SHLVL
        3

        bash-2.05b$ $SHELL -l
        hq4ever@HitSYNC hq4ever $ echo $SHLVL
        4
        hq4ever@HitSYNC hq4ever $ : | :() { :; }
        hq4ever@HitSYNC hq4ever $ logout
   comment : To avoid confusion, both the [exit] & the [logout] commands were
                    not typed by the user, they were "self inputed" by
the shell.


-- 
Cheers, 
Maxim Vexler (hq4ever).

Do u GNU ?




reply via email to

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