Bug 1010761
Summary: | type command output function, Inconsistent with the function definition. | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | JianHong Yin <jiyin> |
Component: | bash | Assignee: | Ondrej Oprala <ooprala> |
Status: | CLOSED NOTABUG | QA Contact: | BaseOS QE - Apps <qe-baseos-apps> |
Severity: | unspecified | Docs Contact: | |
Priority: | high | ||
Version: | 7.0 | CC: | Jame_Liu, jiyin, ovasik |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | 1010759 | Environment: | |
Last Closed: | 2014-02-21 14:44:53 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | 1010759 | ||
Bug Blocks: | 1010760 |
Description
JianHong Yin
2013-09-23 02:15:04 UTC
test in RHEL7 [root@dhcp12-185 ~]# f() { echo $1 | grep --color=auto "kkk"; rm -i kkk; } [root@dhcp12-185 ~]# type f f is a function f () { echo $1 | grep --color=auto --color=auto "kkk"; <<<--- here --color double rm -i -i kkk <<<--- and here -i double } [root@dhcp12-185 ~]# rpm -q bash bash-4.2.45-1.el7.x86_64 Unable to reproduce with bash-4.2.45-2.el7. Are you sure this problem persists in RHEL7? (In reply to Ondrej Oprala from comment #3) > Unable to reproduce with bash-4.2.45-2.el7. Are you sure this problem > persists in RHEL7? Test in bash-4.2.45-1.el7.x86_64 [root@dhcp12-185 ~]# f() { echo $1 | grep --color=auto "kkk"; rm -i kkk; } [root@dhcp12-185 ~]# type f f is a function f () { echo $1 | grep --color=auto --color=auto "kkk"; <<<--- here --color double rm -i -i kkk <<<--- and here -i double } [root@dhcp12-185 ~]# rpm -q bash bash-4.2.45-1.el7.x86_64 <<<--- [yjh@dhcp12-241 ~]$ /usr/bin/bash [yjh@dhcp12-241 ~]$ f() { echo $1 | grep --color=auto "kkk"; rm -i kkk; } [yjh@dhcp12-241 ~]$ type f f is a function f () { echo $1 | grep --color=auto --color=auto "kkk"; <<<--- here --color double still ... rm -i kkk } [yjh@dhcp12-241 ~]$ rpm -q bash bash-4.2.45-3.el7.x86_64 Petr Stodulka investigated this bug and found out this is actually caused by alias expansion. I'm guessing you have an alias rm='rm -i' set, which bash then expands to 'rm -i -i'; which I do not consider a bug. Please note it's a good coding habit to specify full paths for system utilities in shell scripts, which would also stop bash from silently expanding your alias. |