* [9fans] grep: How to filter by plain, non-regexp, string?
@ 2024-09-30 20:56 kalterdev
2024-09-30 21:04 ` akw
0 siblings, 1 reply; 3+ messages in thread
From: kalterdev @ 2024-09-30 20:56 UTC (permalink / raw)
To: 9fans
[-- Attachment #1: Type: text/plain, Size: 474 bytes --]
The general problem is to print lines that contain a string. The
content of the string could be taken from anywhere. It could be a
filename or user input.
In POSIX world, people do grep -F. Plan 9's grep, though, doesn't have
this option.
------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/Tda469be3b0217207-M4bb54202bb487915e0bad6dd
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription
[-- Attachment #2: Type: text/html, Size: 1066 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [9fans] grep: How to filter by plain, non-regexp, string?
2024-09-30 20:56 [9fans] grep: How to filter by plain, non-regexp, string? kalterdev
@ 2024-09-30 21:04 ` akw
2024-09-30 21:47 ` Charles Forsyth
0 siblings, 1 reply; 3+ messages in thread
From: akw @ 2024-09-30 21:04 UTC (permalink / raw)
To: kalterdev, 9fans
From grep(1):
Care should be taken when using the shell metacharacters
$*[^|()=\ and newline in pattern; it is safest to enclose
the entire expression in single quotes '...'. An expression
starting with '*' will treat the rest of the expression as
literal characters.
------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/Tda469be3b0217207-M26a457a8f0766b0f62590605
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [9fans] grep: How to filter by plain, non-regexp, string?
2024-09-30 21:04 ` akw
@ 2024-09-30 21:47 ` Charles Forsyth
0 siblings, 0 replies; 3+ messages in thread
From: Charles Forsyth @ 2024-09-30 21:47 UTC (permalink / raw)
To: 9fans; +Cc: kalterdev
[-- Attachment #1: Type: text/plain, Size: 1026 bytes --]
one reason still to have groups like this is to post things like that so
that in some distant future,
you'll think "wait, i'm sure i read something about this" and look up
the details.
In the now very old days, one of the purposes of man pages was to pack as
much technical detail
as was feasible into a sort of book you could read through, not to memorise
but to remember that
you'd seen it somewhere (and where else would it be, then).
On Mon, 30 Sept 2024 at 22:06, <akw@oneiri.one> wrote:
> From grep(1):
>
> Care should be taken when using the shell metacharacters
> $*[^|()=\ and newline in pattern; it is safest to enclose
> the entire expression in single quotes '...'. An expression
> starting with '*' will treat the rest of the expression as
> literal characters.
------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/Tda469be3b0217207-M4bc3510d4528e83ac20487a7
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription
[-- Attachment #2: Type: text/html, Size: 2462 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-09-30 21:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-30 20:56 [9fans] grep: How to filter by plain, non-regexp, string? kalterdev
2024-09-30 21:04 ` akw
2024-09-30 21:47 ` Charles Forsyth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).