[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug #34917] grep refuses to run when input file is also the output,
From: |
nicolas vigier |
Subject: |
Re: [bug #34917] grep refuses to run when input file is also the output, even when the -q option is used |
Date: |
Mon, 28 Nov 2011 17:23:24 +0100 |
User-agent: |
Mutt/1.5.17 (2007-11-01) |
On Mon, 28 Nov 2011, Jim Meyering wrote:
> Nicolas Vigier wrote:
> > Follow-up Comment #1, bug #34917 (project grep):
> >
> > Oops, I misunderstood the issue reported on Mageia bugzilla.
> >
> > The issue is a little different :
> > When the -q option is used, there should not be any error output. grep
> > version
> > 2.10 outputs errors about "input file `./file' is also the output" even when
> > the -q options is used.
> >
> > But not rejecting the command when the -q option is used should also fix
> > this.
>
> Thanks for forwarding that and for the patch.
> I've added a comment and a proper commit log to your patch, but
> that means you'll have to sign off on the grammar/etc. before I push.
> Please reply here, and not on the savannah tracker.
This looks good. Thanks.
>
> I'll update NEWS and add a test separately.
>
> Note that using -q and redirecting stdout is slightly nonsensical,
> since you know there will be no standard output.
I agree that it does not make a lot of sense to redirect output of grep -q,
however I think it's possible to use grep -q inside a longer script whose
output is redirected to a file, redirecting the output of grep -q at the
same time.