buggrep - Bugs: bug #27770, grep does not print warning when...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #27770: grep does not print warning when recursively grepping stdin

Submitted by:  None
Submitted on:  Wed 21 Oct 2009 03:43:18 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Duplicate
Privacy: PublicAssigned to: None
Open/Closed: Closed

Fri 12 Mar 2010 09:23:38 PM UTC, comment #2:

There's already a patch in the patch tracker, closing as duplicate.

Paolo Bonzini <bonzini>
Fri 04 Dec 2009 01:01:11 PM UTC, comment #1:

Apple's patch to print a warning but continue with stdin appears to be
http://www.opensource.apple.com/darwinsource/10.5.6/grep-24/patches/PR-4053512.diff

Paolo Bonzini <bonzini>
Wed 21 Oct 2009 03:43:18 PM UTC, original submission:

Originally reported downstream at https://bugs.launchpad.net/bugs/457277

A common user error pattern is to call a recursive grep and miss off the trailing '.' for current directory. This causes grep to wait indefinitely for stdin, but users will presume it is just taking a long time to search and will leave it running

$ grep -r PATTERN
...
...
...<indefinite pause>

This is on Ubuntu karmic running the latest GNU grep 2.5.4

Contrastingly, on a Apple Mac running OS X and grep (GNU grep) 2.5.1 a helpful warning is printed in this case which immediately guides the user to their mistake

$ grep -r PATTERN
grep: warning: recursive search of stdin

I presume this is a custom patch that has been applied to the grep binary that ships with OSX (rather than a warning message that has been purposefully removed), therefore I suggest this warning message is added to the default code base.

Anonymous

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bonzini (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 12 Mar 2010 09:23:38 PM UTCbonziniStatusNone=>Duplicate
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1