]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
document expr's new quote operator
authorJim Meyering <jim@meyering.net>
Thu, 12 Jun 1997 16:32:08 +0000 (16:32 +0000)
committerJim Meyering <jim@meyering.net>
Thu, 12 Jun 1997 16:32:08 +0000 (16:32 +0000)
doc/sh-utils.texi

index b72576954fd40299df8972dd45e7521c754d431a..fe0df2c068caac5ca0097ca6d7cc2c8be71caab4 100644 (file)
@@ -721,7 +721,7 @@ Exit status:
 @menu
 * Relations for expr::          | & < <= = == != >= >
 * Numeric expressions::         + - * / %
-* String expressions::          <colon> match substr index length
+* String expressions::          <colon> match substr index length quote
 * Examples of expr::            Examples.
 @end menu
 
@@ -854,6 +854,16 @@ Returns the first position in @var{string} where the first character in
 @findex length
 Returns the length of @var{string}.
 
+@item quote @var{token}
+@findex quote
+Interpret @var{token} as a string, even if it is a keyword like @var{match}
+or an operator like @code{/}.
+This makes it possible to test @code{expr length quote "$x"} or
+@code{expr quote "$x" : '.*/\(.\)'} and have it do the right thing even if
+the value of @var{$x} happens to be @code{/} or @code{index}.
+This operator is provided as a GNU extension.  It is disabled when
+the environment variable, @var{POSIXLY_CORRECT} is set.
+
 @end table
 
 The keywords cannot be used as strings.