View Issue Details

IDProjectCategoryView StatusLast Update
00020191003.1(2024)/Issue8Shell and Utilitiespublic2026-12-05 08:46
Reporterstephane Assigned To 
PrioritynormalSeverityObjectionTypeEnhancement Request
Status NewResolutionOpen 
NameStephane Chazelas
Organization
User Reference
Sectiongrep utility OPTIONS section
Page Number2992
Line Number100084-100085
Interp Status
Final Accepted Text
Summary0002019: grep -s and unreadable pattern files
DescriptionThe -s option of grep is specified as:

> Suppress the error messages ordinarily written for nonexistent or unreadable files.
> Other error messages shall not be suppressed.

Which is unclear as to whether "files" refers to any file or only the input files (passed as argument or stdin). It's also unclear whether "unreadable" is only about failure to read those files, or also covers errors for opening the files for reading other than for "nonexistence".

Testing the GNU, busybox, toybox, ast-open, FreeBSD implementations, with -s, they all suppress errors about opening or reading *input* files, but not about *opening* pattern files.

ast-open's and FreeBSD's seem not to report errors about *reading* files (at least for the EISDIR case which is the easy one I tested), with or without -s, whether that's for the input or pattern files, but I would say that's undesirable and could be considered a bug.
Desired ActionChange the description of the -s option to:

"""
Suppress the error messages ordinarily written upon failure to open or read input files.
Other error messages, including upon failure to open or read pattern files shall not be suppressed.
"""
TagsNo tags attached.

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2026-12-05 08:46 stephane New Issue