Scroll to navigation

HFST-GREP(1) User Commands HFST-GREP(1)

NAME

hfst-grep - =Search for PATTERN in each FILE or standard input.

SYNOPSIS

hfst-grep [OPTIONS...] PATTERN [FILE...]

DESCRIPTION

Search for PATTERN in each FILE or standard input. Pattern is, by default, a Xerox regular expression (XRE). Example: hfst-grep 'h e l l o % w o r l d' menu.h menu.c

Common options:

Print help message
Print version info
Print verbosely while processing
Only print fatal erros and requested output
Alias of --quiet
-9, --format=TYPE
compile expressions to TYPE automata

Regexp selection and interpretation:

PATTERN is an extended regular expression (ERE)
PATTERN is a set of newline-separated fixed strings
PATTERN is a basic regular expression (BRE)
PATTERN is a Perl regular expression
PATTERN is a Xerox regulare expression
use PATTERN for matching
obtain PATTERN from FILE
ignore case distinctions
force PATTERN to match only whole words
force PATTERN to match only whole lines
a data line ends in 0 byte, not newline

Miscellaneous options:

suppress error messages
select non-matching lines

Output control:

stop after NUM matches\n -b, --byte-offset print the byte offset with output lines
print line number with output lines
flush output on every line
print the filename for each match
suppress the prefixing filename on output
print LABEL as filename for standard input
show only the part of a line matching PATTERN
assume that binary files are TYPE; TYPE is `binary', `text', or `without-match'
equivalent to --binary-files=text
how to handle directories; ACTION is `read', `recurse', or `skip'
how to handle devices, FIFOs and sockets; ACTION is `read' or `skip'
equivalent to --directories=recurse
search only files that match FILE_PATTERN
skip files and directories matching FILE_PATTERN
skip files matching any file pattern from FILE
directories that match PATTERN will be skipped
print only names of FILEs containing no match
print only names of FILEs containing matches
print only a count of matching lines per FILE
make tabs line up (if needed)
print 0 byte after FILE name

Context control:

print NUM lines of leading context
print NUM lines of trailing context
print NUM lines of output context

--color[=WHEN],

use markers to highlight the matching strings; WHEN is `always', `never', or `auto'
do not strip CR characters at EOL (MSDOS)
report offsets as if CRs were not there (MSDOS)

REPORTING BUGS

Report bugs to <hfst-bugs@helsinki.fi> or directly to our bug tracker at: <https://github.com/hfst/hfst/issues> hfst-grep home page: <https://github.com/hfst/hfst/wiki/HfstGrep>
General help using HFST software: <https://github.com/hfst/hfst/wiki>

COPYRIGHT

Copyright © 2017 University of Helsinki, License GPLv3: GNU GPL version 3 <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

August 2018 HFST