Bug 698124

Summary: 4.1.7(1)-release disallows a function grep() incorrectly
Product: [Fedora] Fedora Reporter: George R. Goffe <grgoffe>
Component: bashAssignee: Roman Rakus <rrakus>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 14CC: maxamillion, rrakus, tsmetana
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-04-21 14:37:47 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description George R. Goffe 2011-04-20 09:12:26 UTC
Description of problem:

My rc file has a function grep() which gives an error message

Version-Release number of selected component (if applicable):

4.1.7(1)-release

How reproducible:

always

Steps to Reproduce:
1.4.1.7(1)-release
2.define a function grep() { /bin/grep -i $* }
3.observe error message
  
Actual results:

bash: /.grgrc: line 615: syntax error near unexpected token `('
bash: /.grgrc: line 615: `grep()'


Expected results:

an alias for grep which always uses the -i flag

Additional info:

The latest bash in ftp.gnu.org does NOT have this problem but things like "echo -en..." are failing when I install this newer bash in /bin/bash.

Comment 1 Roman Rakus 2011-04-21 14:37:47 UTC
Alias is not function.
In your declaration of function bash didn't know you are declaring a function (grep is command). Use `function' reserved word.

Comment 2 George R. Goffe 2011-04-22 00:45:54 UTC
Roman,

Thanks for your help with this one. I have another question though.

Why does this cause me trouble with 4.1.7 (current FC14 bash, no?) and NOT with bash 4.2?

George...

Comment 3 George R. Goffe 2011-04-22 00:46:56 UTC
Roman,

And I'm really curious why the "echo -en" stuff works on 4.1.7 and not on 4.2.

Regards,

George...

Comment 4 Roman Rakus 2011-04-27 02:21:14 UTC
(In reply to comment #2)
> Roman,
> 
> Thanks for your help with this one. I have another question though.
> 
> Why does this cause me trouble with 4.1.7 (current FC14 bash, no?) and NOT with
> bash 4.2?
> 
> George...

I don't know. I have reproduced it (function vs. alias) on bash 4.1 and 4.2.

(In reply to comment #3)
> Roman,
> 
> And I'm really curious why the "echo -en" stuff works on 4.1.7 and not on 4.2.
> 
> Regards,
> 
> George...

I don't know what are you talking about. Anyway, using printf instead of echo is prefered!

Comment 5 George R. Goffe 2011-04-28 23:32:30 UTC
Roman,

The scripts I was referring to came from the initscripts package.

I got my bash4.2 from the gnu ftp site and installed the patches in that directory. Did you install them as well?

Regards,

George...