Re: find a document bug for expr
[EMAIL PROTECTED] wrote: I think I have found a document bug for expr: in the info page of String expressions, it says `expr' supports pattern matching and other string operators. These have *lower* precedence than both the numeric and ...,. But I think the string expressions have *higher* precedence than numeric operator. For example, this expression should return 17: $ expr ' a16b' : ' a\(..\)b' + 1 And in Numeric expressions and Relations for expr, there are the same problems as this: they state the wrong precedence. Thank you. I've fixed it like this: * coreutils.texi (expr invocation): Correct description of relative operator precedence. Reported by [EMAIL PROTECTED] diff --git a/doc/coreutils.texi b/doc/coreutils.texi index ce40f4e..c11c06a 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -10804,7 +10804,7 @@ Exit status: @cindex expressions, string @command{expr} supports pattern matching and other string operators. These -have lower precedence than both the numeric and relational operators (in +have higher precedence than both the numeric and relational operators (in the next sections). @table @samp @@ -10884,8 +10884,9 @@ To make @command{expr} interpret keywords as strings, you must use the @cindex expressions, numeric @command{expr} supports the usual numeric operators, in order of increasing -precedence. The string operators (previous section) have lower precedence, -the connectives (next section) have higher. +precedence. These numeric operators have higher precedence than the +string operators described in the previous section, and lower precedence +than the connectives (next section). @table @samp @@ -10918,7 +10919,7 @@ integers; an error occurs if this cannot be done. @cindex relations, numeric or string @command{expr} supports the usual logical connectives and relations. These -are higher precedence than either the string or numeric operators +have lower precedence than the string and numeric operators (previous sections). Here is the list, lowest-precedence operator first. @table @samp ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
Re: find a document bug for expr
Jim Meyering [EMAIL PROTECTED] writes: @@ -10884,8 +10884,9 @@ To make @command{expr} interpret keywords as strings, you must use the @cindex expressions, numeric @command{expr} supports the usual numeric operators, in order of increasing -precedence. The string operators (previous section) have lower precedence, -the connectives (next section) have higher. +precedence. These numeric operators have higher precedence than the +string operators described in the previous section, and lower precedence +than the connectives (next section). That's exactly as backwards as before. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now for something completely different. ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
Re: find a document bug for expr
Andreas Schwab [EMAIL PROTECTED] wrote: Jim Meyering [EMAIL PROTECTED] writes: @@ -10884,8 +10884,9 @@ To make @command{expr} interpret keywords as strings, you must use the @cindex expressions, numeric @command{expr} supports the usual numeric operators, in order of increasing -precedence. The string operators (previous section) have lower precedence, -the connectives (next section) have higher. +precedence. These numeric operators have higher precedence than the +string operators described in the previous section, and lower precedence +than the connectives (next section). Good catch. Fix typo in previous change. Spotted by Andreas Schwab. --- doc/coreutils.texi |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/coreutils.texi b/doc/coreutils.texi index c11c06a..71a71a4 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -10884,8 +10884,8 @@ To make @command{expr} interpret keywords as strings, you must use the @cindex expressions, numeric @command{expr} supports the usual numeric operators, in order of increasing -precedence. These numeric operators have higher precedence than the -string operators described in the previous section, and lower precedence +precedence. These numeric operators have lower precedence than the +string operators described in the previous section, and higher precedence than the connectives (next section). @table @samp -- 1.5.3.1.19.gb5ef6-dirty ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
find a document bug for expr
hi, I think I have found a document bug for expr: in the info page of String expressions, it says `expr' supports pattern matching and other string operators. These have *lower* precedence than both the numeric and ...,. But I think the string expressions have *higher* precedence than numeric operator. For example, this expression should return 17: $ expr ' a16b' : ' a\(..\)b' + 1 And in Numeric expressions and Relations for expr, there are the same problems as this: they state the wrong precedence. ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils