From a6062bfb0566cdb406c82c1dda8a3a1a59a9fd9c Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 12 Jun 1997 16:32:08 +0000 Subject: document expr's new quote operator --- doc/sh-utils.texi | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'doc') 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:: 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. -- cgit v1.2.3-70-g09d2