[Bug 293217] grep(1) reads EOF twice from interactive stdin before quitting
- Reply: bugzilla-noreply_a_freebsd.org: "[Bug 293217] grep(1) reads EOF twice from interactive stdin before quitting"
- Reply: bugzilla-noreply_a_freebsd.org: "[Bug 293217] grep(1) reads EOF twice from interactive stdin before quitting"
- Reply: bugzilla-noreply_a_freebsd.org: "[Bug 293217] grep(1) reads EOF twice from interactive stdin before quitting"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 16 Feb 2026 18:15:25 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293217
Bug ID: 293217
Summary: grep(1) reads EOF twice from interactive stdin before
quitting
Product: Base System
Version: Unspecified
Hardware: Any
OS: Any
Status: New
Severity: Affects Only Me
Priority: ---
Component: bin
Assignee: bugs@FreeBSD.org
Reporter: freebsd@tim.thechases.com
Running `grep(1)` interactively and immediately pressing control+d to send an
EOF, it registers the ^D but then requires a *second* control+d to actually
quit. On both OpenBSD & Ubuntu, grep(1) quits immediately at the first
control+d as expected:
$ grep x
^D
^D
If a line of any other input is provided before the control+d it behaves
properly.
$ grep x
hello
^D
(this was encountered while testing the exit status code for `grep` and `grep
-v` on various inputs including empty)
--
You are receiving this mail because:
You are the assignee for the bug.