From: Christos Zoulas Date: Mon, 8 Jan 2007 17:09:30 +0000 (+0000) Subject: Fix docs. X-Git-Tag: FILE4_20~43 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3194a3dd2fbc9ae7a02c8341f4c794fabe01f793;p=file Fix docs. --- diff --git a/doc/magic.man b/doc/magic.man index 9bd9fa79..95cf8af5 100644 --- a/doc/magic.man +++ b/doc/magic.man @@ -125,11 +125,12 @@ than UTC. .IP regex A regular expression match in extended POSIX regular expression syntax (much like egrep). -The type specification can be optionally followed by -.B /c -for case-insensitive matches. -The regular expression is always -tested against the first +The type specification can be optionally followed by /[cse]*. +The ``c'' flag makes the match case insensitive, while the ``s'' or +``e'' flags update the offset to the starting or ending offsets of the +match (only one should be used). +By default, regex does not update the offset. +The regular expression is always tested against the first .B N lines, where .B N @@ -148,6 +149,11 @@ This is suitable for searching larger binary expressions with variable offsets, using .B \e escapes for special characters. +.IP default +This is intended to be used with the text +.B x +(which is always true) and a message that is to be used if there are +no other matches. .RE .PP The numeric types may optionally be followed by @@ -222,12 +228,19 @@ This means that a line can match any string, and then presumably print that string, by doing .B >\e0 (because all strings are greater than the null string). +.IP +The special test +.B x +always evaluates to true. .IP message The message to be printed if the comparison succeeds. If the string contains a .BR printf (3) format specification, the value from the file (with any specified masking performed) is printed using the message as the format string. +If the string begins with ``\\b'', the message printed is the +remainder of the string with no whitespace added before it: multiple +matches are normally separated by a single space. .PP Some file formats contain additional information which is to be printed along with the file type or need additional tests to determine the true @@ -422,4 +435,4 @@ a system on which the lengths are invariant. .\" the changes I posted to the S5R2 version. .\" .\" Modified for Ian Darwin's version of the file command. -.\" @(#)$Id: magic.man,v 1.33 2006/10/31 19:37:16 christos Exp $ +.\" @(#)$Id: magic.man,v 1.34 2007/01/08 17:09:30 christos Exp $