]> granicus.if.org Git - file/commitdiff
Fix docs.
authorChristos Zoulas <christos@zoulas.com>
Mon, 8 Jan 2007 17:09:30 +0000 (17:09 +0000)
committerChristos Zoulas <christos@zoulas.com>
Mon, 8 Jan 2007 17:09:30 +0000 (17:09 +0000)
doc/magic.man

index 9bd9fa797fba6a0d08019237880d808ba15514c9..95cf8af5f3d7ace8217268fd840529fab7e5ff2f 100644 (file)
@@ -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 $