From: Jim Meyering Date: Thu, 12 Jun 1997 16:32:08 +0000 (+0000) Subject: document expr's new quote operator X-Git-Tag: SH-UTILS-1_16a~36 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a6062bfb0566cdb406c82c1dda8a3a1a59a9fd9c;p=thirdparty%2Fcoreutils.git document expr's new quote operator --- diff --git a/doc/sh-utils.texi b/doc/sh-utils.texi index b72576954f..fe0df2c068 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:: match substr index length +* String expressions:: 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.