Bug 1298499 - q command does not immediately quit
Summary: q command does not immediately quit
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: sed
Version: 23
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Petr Stodulka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-01-14 09:42 UTC by Robin Green
Modified: 2016-07-07 15:34 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-07 15:34:02 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Robin Green 2016-01-14 09:42:40 UTC
Description of problem:
The info page for sed says that the q command immediately quits. However, it doesn't.

Version-Release number of selected component (if applicable):
sed-4.2.2-11.fc23.x86_64

How reproducible:
Always

Steps to Reproduce:
(echo 'PostgreSQL init process complete; ready for start up.'; sleep 3; echo foo)|sed -n -e '/PostgreSQL init process complete/q'

Actual results:
Output is correct (no output) but it takes 3 seconds

Expected results:
Should return instantly

Additional info:
Same bug happens with Q, or Q 1

Comment 1 Paolo Bonzini 2016-07-07 15:34:02 UTC
sed does quit immediately, but the shell doesn't exit until the whole pipeline is done.  Try this:

$ (echo 'PostgreSQL init process complete; ready for start up.'; sleep 3;
     echo foo)|(sed -n -e '/PostgreSQL init process complete/q'; echo bar)

And you'll see that "bar" is printed immediately.


Note You need to log in before you can comment on or make changes to this bug.