bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#24067: Bug Report : How to grep and treat meta character as normal c


From: bibek ghimire
Subject: bug#24067: Bug Report : How to grep and treat meta character as normal character?
Date: Tue, 26 Jul 2016 10:25:29 -0500

Hi Jim,
         After following your comment, the error (I am not sure now if I
could call it an error) has gone. So you were right, it was due to the way
I was handling positional parameters in my .profile file.

Sol: changing from

grep ()

{

    /usr/bin/grep --color=auto $*

}


to

grep ()

{

    /usr/bin/grep --color=auto "$@"

}
solved it. (Not sure ';' is required here )

-Bibek

On Tue, Jul 26, 2016 at 10:07 AM, Jim Meyering <address@hidden> wrote:

> On Tue, Jul 26, 2016 at 7:46 AM, bibek ghimire <address@hidden> wrote:
> >     /usr/bin/grep --color=auto $*
>
> That function is erroneous due to the use of unquoted $*.
> Use this instead, which fixes that, and also works when the executable
> grep is not in /usr/bin:
>
> grep() { env grep --color=auto "$@"; }
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]