Message ID | 20220914090610.1994485-2-jencce.kernel@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/2] egrep, fgrep: deprecated | expand |
On Wed, Sep 14, 2022 at 05:06:10PM +0800, Murphy Zhou wrote: > The second dash is not needed now. Newer grep is complaining: > +grep: warning: stray \ before - > > Signed-off-by: Murphy Zhou <jencce.kernel@gmail.com> > --- > common/quota | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/common/quota b/common/quota > index 22be3c69..01ff7e6d 100644 > --- a/common/quota > +++ b/common/quota > @@ -218,7 +218,7 @@ _qmount() > quotacheck -ug $SCRATCH_MNT >>$seqres.full 2>&1 > quotaon -ug $SCRATCH_MNT >>$seqres.full 2>&1 > # try to turn on project quota if it's supported > - if quotaon --help 2>&1 | grep -q '\-\-project'; then > + if quotaon --help 2>&1 | grep -q '\--project'; then Yeah, I can reproduce the problem [1] you said. But I'm wondering if using "--" [2] might be better to be compatible with old and new grep ? Thanks, Zorro [1] # quotaon --help 2>&1|grep '\--project' -P, --project operate on project quotas # quotaon --help 2>&1|grep '\-\-project' grep: warning: stray \ before - -P, --project operate on project quotas [2] quotaon --help 2>&1 | "grep -q -- '--project' > quotaon --project $SCRATCH_MNT >>$seqres.full 2>&1 > fi > fi > -- > 2.31.1 >
On Wed, Sep 14, 2022 at 11:24 PM Zorro Lang <zlang@redhat.com> wrote: > > On Wed, Sep 14, 2022 at 05:06:10PM +0800, Murphy Zhou wrote: > > The second dash is not needed now. Newer grep is complaining: > > +grep: warning: stray \ before - > > > > Signed-off-by: Murphy Zhou <jencce.kernel@gmail.com> > > --- > > common/quota | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/common/quota b/common/quota > > index 22be3c69..01ff7e6d 100644 > > --- a/common/quota > > +++ b/common/quota > > @@ -218,7 +218,7 @@ _qmount() > > quotacheck -ug $SCRATCH_MNT >>$seqres.full 2>&1 > > quotaon -ug $SCRATCH_MNT >>$seqres.full 2>&1 > > # try to turn on project quota if it's supported > > - if quotaon --help 2>&1 | grep -q '\-\-project'; then > > + if quotaon --help 2>&1 | grep -q '\--project'; then > > Yeah, I can reproduce the problem [1] you said. But I'm wondering if using > "--" [2] might be better to be compatible with old and new grep ? Agree! Thanks! > > Thanks, > Zorro > > [1] > # quotaon --help 2>&1|grep '\--project' > -P, --project operate on project quotas > # quotaon --help 2>&1|grep '\-\-project' > grep: warning: stray \ before - > -P, --project operate on project quotas > > [2] > quotaon --help 2>&1 | "grep -q -- '--project' > > > quotaon --project $SCRATCH_MNT >>$seqres.full 2>&1 > > fi > > fi > > -- > > 2.31.1 > > >
diff --git a/common/quota b/common/quota index 22be3c69..01ff7e6d 100644 --- a/common/quota +++ b/common/quota @@ -218,7 +218,7 @@ _qmount() quotacheck -ug $SCRATCH_MNT >>$seqres.full 2>&1 quotaon -ug $SCRATCH_MNT >>$seqres.full 2>&1 # try to turn on project quota if it's supported - if quotaon --help 2>&1 | grep -q '\-\-project'; then + if quotaon --help 2>&1 | grep -q '\--project'; then quotaon --project $SCRATCH_MNT >>$seqres.full 2>&1 fi fi
The second dash is not needed now. Newer grep is complaining: +grep: warning: stray \ before - Signed-off-by: Murphy Zhou <jencce.kernel@gmail.com> --- common/quota | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)