fnmatch

Package: WA2L/edrc 1.5.57
Section: Library Commands (3)
Updated: 25 June 2023
Index Return to Main Contents

 

NAME

fnmatch - wildcard pattern match of a stream

 

SYNOPSIS

edrc/lib/fnmatch [ -h | -V ]

fnmatch [ -n ] [ -m num ] [ -i ] [ -v ] [ -e ] pattern < file

cat file | fnmatch [ -n ] [ -m num ] [ -i ] [ -v ] [ -e ] pattern

 

AVAILABILITY

WA2L/edrc

 

DESCRIPTION

match a stream by a wildcard pattern expression.

Wildcard expressions are different to regular expressions and are known for example from the ls(1) command.

However, in some applications wildcard patterns are more intuitive to use then regular expressions.

 

OPTIONS

-h
usage message.

-V
print command version.

-n
prefix each line of output with the 1-based line number within its input file.

-m num
stop reading a file after num matching lines.

-i
case insensitive match.

-e
extended expression as known in ksh:

The extended format is as follows, with pattern-list being a '|' separated list of patterns.

'?(pattern-list)'
The pattern matches if zero or one occurrences of any of the patterns in the pattern-list match the input stream.

'*(pattern-list)'
The pattern matches if zero or more occurrences of any of the patterns in the pattern-list match the input stream.

'+(pattern-list)'
The pattern matches if one or more occurrences of any of the patterns in the pattern-list match the input stream.

'@(pattern-list)'
The pattern matches if exactly one occurrence of any of the patterns in the pattern-list match the input stream.

'!(pattern-list)'
The pattern matches if the input stream cannot be matched

-v
invert the sense of matching, to select non-matching lines.

pattern
wildcard expression to match the stream:

*
Matches any string, including the null string.

?
Matches any single character.

[?]
Matches the question mark (?) character.

[...]
Matches any one of the characters enclosed. A pair of characters separated by - matches any character lexically between the pair.

[!...]
Matches any character except the enclosed ones.

 

ENVIRONMENT

-

 

EXIT STATUS

0
match

1
no match.

4
usage printed.

5
version printed.

 

FILES

-

 

EXAMPLES

-

 

SEE ALSO

edrcintro(1), egrep(1), fgrep(1), grep(1), ksh(1), regexintro(4)

 

NOTES

-

 

BUGS

-

 

AUTHOR

fnmatch was developed by Christian Walther. Send suggestions and bug reports to wa2l@users.sourceforge.net . 

 

COPYRIGHT

Copyright © 2023 Christian Walther

This is free software; see edrc/doc/COPYING for copying conditions. There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


 

Index

NAME
SYNOPSIS
AVAILABILITY
DESCRIPTION
OPTIONS
ENVIRONMENT
EXIT STATUS
FILES
EXAMPLES
SEE ALSO
NOTES
BUGS
AUTHOR
COPYRIGHT

This document was created by man2html using the manual pages.
Time: 16:53:02 GMT, August 28, 2024