diff options
Diffstat (limited to 'coreutils/expr.c')
-rw-r--r-- | coreutils/expr.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/coreutils/expr.c b/coreutils/expr.c index 04d783f2b..24e75b556 100644 --- a/coreutils/expr.c +++ b/coreutils/expr.c | |||
@@ -25,6 +25,41 @@ | |||
25 | 25 | ||
26 | /* no getopt needed */ | 26 | /* no getopt needed */ |
27 | 27 | ||
28 | //usage:#define expr_trivial_usage | ||
29 | //usage: "EXPRESSION" | ||
30 | //usage:#define expr_full_usage "\n\n" | ||
31 | //usage: "Print the value of EXPRESSION to stdout\n" | ||
32 | //usage: "\n" | ||
33 | //usage: "EXPRESSION may be:\n" | ||
34 | //usage: " ARG1 | ARG2 ARG1 if it is neither null nor 0, otherwise ARG2\n" | ||
35 | //usage: " ARG1 & ARG2 ARG1 if neither argument is null or 0, otherwise 0\n" | ||
36 | //usage: " ARG1 < ARG2 1 if ARG1 is less than ARG2, else 0. Similarly:\n" | ||
37 | //usage: " ARG1 <= ARG2\n" | ||
38 | //usage: " ARG1 = ARG2\n" | ||
39 | //usage: " ARG1 != ARG2\n" | ||
40 | //usage: " ARG1 >= ARG2\n" | ||
41 | //usage: " ARG1 > ARG2\n" | ||
42 | //usage: " ARG1 + ARG2 Sum of ARG1 and ARG2. Similarly:\n" | ||
43 | //usage: " ARG1 - ARG2\n" | ||
44 | //usage: " ARG1 * ARG2\n" | ||
45 | //usage: " ARG1 / ARG2\n" | ||
46 | //usage: " ARG1 % ARG2\n" | ||
47 | //usage: " STRING : REGEXP Anchored pattern match of REGEXP in STRING\n" | ||
48 | //usage: " match STRING REGEXP Same as STRING : REGEXP\n" | ||
49 | //usage: " substr STRING POS LENGTH Substring of STRING, POS counted from 1\n" | ||
50 | //usage: " index STRING CHARS Index in STRING where any CHARS is found, or 0\n" | ||
51 | //usage: " length STRING Length of STRING\n" | ||
52 | //usage: " quote TOKEN Interpret TOKEN as a string, even if\n" | ||
53 | //usage: " it is a keyword like 'match' or an\n" | ||
54 | //usage: " operator like '/'\n" | ||
55 | //usage: " (EXPRESSION) Value of EXPRESSION\n" | ||
56 | //usage: "\n" | ||
57 | //usage: "Beware that many operators need to be escaped or quoted for shells.\n" | ||
58 | //usage: "Comparisons are arithmetic if both ARGs are numbers, else\n" | ||
59 | //usage: "lexicographical. Pattern matches return the string matched between\n" | ||
60 | //usage: "\\( and \\) or null; if \\( and \\) are not used, they return the number\n" | ||
61 | //usage: "of characters matched or 0." | ||
62 | |||
28 | #include "libbb.h" | 63 | #include "libbb.h" |
29 | #include "xregex.h" | 64 | #include "xregex.h" |
30 | 65 | ||