[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
command builtin should disable different behavior for special built-ins
From: |
Siteshwar Vashisht |
Subject: |
command builtin should disable different behavior for special built-ins |
Date: |
Fri, 28 Apr 2017 06:55:16 -0400 (EDT) |
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-redhat-linux-gnu'
-DCONF_VENDOR='redhat' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL
-DHAVE_CONFIG_H -I. -I\
. -I./include -I./lib -D_GNU_SOURCE -DRECYCLES_PIDS
-DDEFAULT_PATH_VALUE='/usr/local/bin:/usr/bin' -O2 -g -pipe -Wall
-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fstack-protector-strong --param=ssp-buffer-size=4 -gre\
cord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64
-mtune=generic -Wno-parentheses -Wno-format-security
uname output: Linux localhost.localdomain 4.11.0-0.rc8.git0.1.fc27.x86_64 #1
SMP Mon Apr 24 15:30:53 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-redhat-linux-gnu
Bash Version: 4.4
Patch Level: 12
Release Status: release
Description:
In POSIX mode, command builtin should disable different behavior for special
built-ins.
According to description for special builtin-ins[1] in POSIX, a special builtin
may cause shell to abort on error :
An error in a special built-in utility may cause a shell executing that utility
to abort
However as per [2], command builtin should disable different behavior for
special builtins :
If the command_name is the same as the name of one of the special built-in
utilities, the special properties in the enumerated list at the beginning of
Special Built-In Utilities shall not occur.
[1]
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_14
[2] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/command.html
Repeat-By:
sh -c 'readonly VAR=123; command eval "VAR=123"; echo $?'
Actual output:
shell aborts at below error:
sh: VAR: readonly variable
Expected output:
'echo $?' should be executed :
sh: VAR: readonly variable
1
--
--
Siteshwar Vashisht
- command builtin should disable different behavior for special built-ins,
Siteshwar Vashisht <=