emacs-bug-tracker
[Top][All Lists]
Advanced

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

[debbugs-tracker] bug#21621: closed (Bug | grep | Running in loop)


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#21621: closed (Bug | grep | Running in loop)
Date: Mon, 05 Oct 2015 20:41:03 +0000

Your message dated Mon, 5 Oct 2015 14:39:56 -0600
with message-id <address@hidden>
and subject line Re: bug#21621: Bug | grep | Running in loop
has caused the debbugs.gnu.org bug report #21621,
regarding Bug | grep | Running in loop
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
21621: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21621
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: Bug | grep | Running in loop Date: Mon, 05 Oct 2015 15:29:56 +0200
Dear ladies and gentlemen,

I would like to report a bug.
When I run this command:
grep -rl '^PATTERN$'.
^C
(Pay attention to the non-whitespace between pattern and target directory.)

It seems like it’s running in a loop, though, I was expecting a timeout would occur after a while.
Can you confirm it's a bug and the behaviour is expected?

Best Regards
Gino Atlas



--- End Message ---
--- Begin Message --- Subject: Re: bug#21621: Bug | grep | Running in loop Date: Mon, 5 Oct 2015 14:39:56 -0600 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0
tag 21621 notabug
thanks

On 10/05/2015 07:29 AM, Gino Atlas wrote:
> Dear ladies and gentlemen,
> 
> I would like to report a bug.
> When I run this command:
> grep -rl '^PATTERN$'.
> ^C
> (Pay attention to the non-whitespace between pattern and target directory.)
> 
> It seems like it’s running in a loop, though, I was expecting a timeout
> would occur after a while.
> Can you confirm it's a bug and the behaviour is expected?
> 

Yes, that is the expected behavior.  You didn't tell grep what file to
read, so it is defaulting to reading stdin.  But stdin is your terminal,
and grep is waiting for you to type.  When you are done with your input,
type Ctrl-D to tell the terminal to send an EOF to grep, so that it can
quit reading stdin.

Perhaps it could be argued that grep should recognize when its stdin is
a terminal, and issue a warning to the user that they may have forgotten
to specify an input location and to press ctrl-D to break out of grep
waiting for the user to type something.  But GNU Coding Standards
discourage a program behaving differently merely because stdin is a
terminal.

At any rate, since the behavior is intentional, and since grep is
waiting for you to do something (it is NOT burning 100% CPU during that
wait), I'm marking this as not a bug. However, feel free to add more
comments or questions on the topic.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


--- End Message ---

reply via email to

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