coreutils commands: move pages to common/ folder (#2442)

This commit is contained in:
Felix Yan
2018-10-17 01:29:50 +08:00
committed by Starbeamrainbowlabs
parent 9ef7ec119a
commit 72b4f22ff9
36 changed files with 4 additions and 23 deletions

23
pages/common/expr.md Normal file
View File

@@ -0,0 +1,23 @@
# expr
> Evaluate expressions and manipulate strings.
- Get string length:
`expr length {{string}}`
- Evaluate logical or math expression with an operator ('+', '-', '*', '&', '|', etc.). Special symbols should be escaped:
`expr {{first_argument}} {{operator}} {{second_argument}}`
- Get position of the first character in 'string' that matches 'substring':
`echo $(expr index {{string}} {{substring}})`
- Extract part of the string:
`echo $(expr substr {{string}} {{position_to_start}} {{number_of_characters}}`
- Extract part of the string which matches a regular expression:
`echo $(expr {{string}} : '\({{regular_expression}}\)')`