Bug 698124 - 4.1.7(1)-release disallows a function grep() incorrectly
Summary: 4.1.7(1)-release disallows a function grep() incorrectly
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: bash
Version: 14
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Roman Rakus
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-04-20 09:12 UTC by George R. Goffe
Modified: 2014-01-13 00:13 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-04-21 14:37:47 UTC
Type: ---


Attachments (Terms of Use)

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...


Note You need to log in before you can comment on or make changes to this bug.