S6-GREP(1)

NAME
s6-grep - match input against a pattern

SYNOPSIS
s6-grep [-E | -F] [-i] [-c] [-n] [-q] [-v] pattern

DESCRIPTION
s6-grep compiles pattern as a Basic Regular Expression[2]. It reads stdin and matches every line against this regexp. If the line matches, it prints it to stdout.

It exits on EOF with code 0 if one or more lines matched and 1 otherwise.

OPTIONS

-F  pattern is not compiled as a BRE, but is interpreted as a literal string.

-E  pattern is not compiled as a BRE, but as an Extended Regular Expression[3].

-i  Ignore case during the match.

-c  Do not write normal output; only write the number of lines that have matched pattern after EOF is received.

-n  Precede every output line by its number and a colon. The first input line has number 1.

-q  Do not write anything to stdout.

-v  Invert the pattern matching ( select lines that do not match pattern).

EXIT STATUS

111 Temporary error.

100 Permanent error, such as a misuse.

127 Unable to execute program - not found.

126 Unable to execute program - other reason.

SEE ALSO
s6-basename(1), s6-cat(1), s6-chmod(1), s6-chown(1), s6-clock(1), s6-cut(1), s6-dirname(1), s6-dumpenv(1), s6-echo(1), s6-env(1), s6-expr(1), s6-false(1), s6-format-filter(1), s6-head(1), s6-hiercopy(1), s6-linkname(1), s6-ln(1), s6-ls(1), s6-maximumtime(1), s6-mkdir(1), s6-mkfifo(1), s6-nice(1), s6-nuke(1), s6-pause(1), s6-printenv(1), s6-quote(1), s6-quote-filter(1), s6-rename(1), s6-rmrf(1), s6-seq(1), s6-sleep(1), s6-sort(1), s6-sync(1), s6-tai64ndiff(1), s6-tail(1), s6-touch(1), s6-true(1), s6-uniquename(1), s6-unquote(1), s6-unquote-filter(1), s6-update-symlinks(1), seekablepipe(1)

[1] https://pubs.opengroup.org/onlinepubs/9799919799/utilities/grep.html

[2] https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap09.html#tag_09_03

[3] https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap09.html#tag_09_04

This man page is ported from the authoritative documentation at: https://skarnet.org/software/s6-portable-utils/s6-grep.html

STANDARDS
s6-grep is not suitable as a grep [1] program conforming to p1003.1-2024.

AUTHORS
Laurent Bercot Alexis <flexibeast@gmail.com> (man page port)