syntax:ccmd:conditional_expression

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
syntax:ccmd:conditional_expression [2015/04/30 11:27]
mklement0 [Portability considerations]
syntax:ccmd:conditional_expression [2017/02/01 05:54]
fgrose [Table] Provide link to arithmetic comparisons and expression command
Line 20: Line 20:
 | ''<​STRING>​ **=~** <​ERE>'' ​                                          | ''<​STRING>''​ is checked against the [[https://​en.wikipedia.org/​wiki/​Regular_expression#​POSIX_extended|extended regular expression]] ''<​ERE>''​ - ''​TRUE''​ on a match  | | ''<​STRING>​ **=~** <​ERE>'' ​                                          | ''<​STRING>''​ is checked against the [[https://​en.wikipedia.org/​wiki/​Regular_expression#​POSIX_extended|extended regular expression]] ''<​ERE>''​ - ''​TRUE''​ on a match  |
 | See the [[commands:​classictest#​file_tests|classic test operators]] ​ | Do **not** use the ''​test''​-typical operators ''​-a''​ and ''​-o''​ for AND and OR.                                                                                      | | See the [[commands:​classictest#​file_tests|classic test operators]] ​ | Do **not** use the ''​test''​-typical operators ''​-a''​ and ''​-o''​ for AND and OR.                                                                                      |
 +| See also [[syntax:​arith_expr#​comparisons|arithmetic comparisons]] ​  | Using ''​%%(( <​EXPRESSION>​ ))%%'',​ the [[syntax:​ccmd:​arithmetic_eval|arithmetic expression compound command]] ​                                                        |
  
  
Line 90: Line 91:
 </​code>​ </​code>​
  
-The interpretion ​of quoted regular expression special characters can be influenced by setting the ''​compat31''​ and ''​compat32''​ shell options (''​compat*''​ in general). See [[internals:​shell_options]].+The interpretation ​of quoted regular expression special characters can be influenced by setting the ''​compat31''​ and ''​compat32''​ shell options (''​compat*''​ in general). See [[internals:​shell_options]].
  
 ==== Behaviour differences compared to the builtin test command ==== ==== Behaviour differences compared to the builtin test command ====
  
-As of Bash 4.1 alpha, the test primaries '<'​ and '>'​ (compare strings lexicographically) use the current locale settings, while the same primitives for the builtin test command don't. This leads to the following situation where both behave differently:​+As of Bash 4.1 alpha, the test primaries '<'​ and '>'​ (compare strings lexicographically) use the current locale settings, while the same primitives for the builtin test command don't. This leads to the following situation where they behave differently:​
 <​code>​ <​code>​
 $ ./cond.sh $ ./cond.sh
  • syntax/ccmd/conditional_expression.txt
  • Last modified: 2017/02/08 22:30
  • by fgrose