Description of problem: type command output function, Inconsistent with the function definition. Version-Release number of selected component (if applicable): [root@dhcp-13-194 ~]# rpm -q bash bash-3.2-32.el5; in RHEL6.4 6.5 7.0 has the similar problem. How reproducible: 100% Steps to Reproduce: 1. f() { echo $1 | grep --color=auto "kkk"; rm -i kkk; } 2. type f 3. Actual results: [root@dhcp-13-194 ~]# f() { echo $1 | grep --color=auto "kkk"; rm -i kkk; } [root@dhcp-13-194 ~]# type f f is a function f () { echo $1 | grep --color=auto "kkk"; rm -i -i kkk <<<--- here the '-i' was changed to double } Expected results: Additional info:
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.