summaryrefslogtreecommitdiff
path: root/doc/sh-utils.texi
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1997-06-12 16:32:08 +0000
committerJim Meyering <jim@meyering.net>1997-06-12 16:32:08 +0000
commita6062bfb0566cdb406c82c1dda8a3a1a59a9fd9c (patch)
tree377e5407bd0cd02874e417ce8f19893240bf030e /doc/sh-utils.texi
parent83461932b5f9c189f5a618e7de63c05c6027db29 (diff)
downloadcoreutils-a6062bfb0566cdb406c82c1dda8a3a1a59a9fd9c.tar.xz
document expr's new quote operator
Diffstat (limited to 'doc/sh-utils.texi')
-rw-r--r--doc/sh-utils.texi12
1 files changed, 11 insertions, 1 deletions
diff --git a/doc/sh-utils.texi b/doc/sh-utils.texi
index b72576954..fe0df2c06 100644
--- a/doc/sh-utils.texi
+++ b/doc/sh-utils.texi
@@ -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.