[Top][All Lists]

[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: address@hidden
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

        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 :


        : | :() { :; }

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

        bash-2.05b$ $SHELL -l
        address@hidden hq4ever $ echo $SHLVL
        address@hidden hq4ever $ : | :() { :; }
        address@hidden 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.

Maxim Vexler (hq4ever).

Do u GNU ?

reply via email to

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