Bug 1298499 - q command does not immediately quit
q command does not immediately quit
Status: CLOSED WORKSFORME
Product: Fedora
Classification: Fedora
Component: sed (Show other bugs)
23
x86_64 Linux
unspecified Severity medium
: ---
: ---
Assigned To: pstodulk
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-14 04:42 EST by Robin Green
Modified: 2016-07-07 11:34 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-07-07 11:34:02 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Robin Green 2016-01-14 04:42:40 EST
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 11:34:02 EDT
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.