bug-bash
[Top][All Lists]
Advanced

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

"implicit" unset of a read-only function unsets the functions


From: jens . schmidt35
Subject: "implicit" unset of a read-only function unsets the functions
Date: Fri, 11 Nov 2011 17:20:58 +0100 (CET)

Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: cc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' 
-DCONF_VENDOR='pc' 
-DLOCALEDIR='/sapmnt/oraicall/home/tools/bash-4.1/share/locale' 
-DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib   -g -O2
uname output: Linux ls3094 2.6.18-8.el5 #1 SMP Fri Jan 26 14:15:21 EST 2007 
i686 i686 i386 GNU/Linux
Machine Type: i686-pc-linux-gnu

Bash Version: 4.1
Patch Level: 9
Release Status: release

Description:
        If there is a read-only function f, and no variable f,
        then you cannot unset function f with "unset -f f", but
        you can unset it with "unset f".

        Since f is read-only, it should not be possible to unset it
        either way.

Repeat-By:
        [ldm046:~]$ f() { :; }
        [ldm046:~]$ readonly -f f
        [ldm046:~]$ unset -f f
        bash: unset: f: cannot unset: readonly function
        [ldm046:~]$ unset f
        [ldm046:~]$ type f
        bash: type: f: not found



reply via email to

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