Penguin
Annotated edit history of expr(1) version 1, including all changes. View license author blame.
Rev Author # Line
1 perry 1 EXPR
2 !!!EXPR
3 NAME
4 SYNOPSIS
5 DESCRIPTION
6 AUTHOR
7 REPORTING BUGS
8 COPYRIGHT
9 SEE ALSO
10 ----
11 !!NAME
12
13
14 expr - evaluate expressions
15 !!SYNOPSIS
16
17
18 __expr__ ''EXPRESSION''__
19 expr__ ''OPTION''
20 !!DESCRIPTION
21
22
23 __--help__
24
25
26 display this help and exit
27
28
29 __--version__
30
31
32 output version information and exit
33
34
35 Print the value of EXPRESSION to standard output. A blank
36 line below separates increasing precedence groups.
37 EXPRESSION may be:
38
39
40 ARG1 | ARG2
41
42
43 ARG1 if it is neither null nor 0, otherwise
44 ARG2
45
46
47 ARG1
48
49
50 ARG1 if neither argument is null or 0, otherwise
51 0
52
53
54 ARG1
55
56
57 ARG1 is less than ARG2
58
59
60 ARG1
61
62
63 ARG1 is less than or equal to ARG2
64
65
66 ARG1 = ARG2
67
68
69 ARG1 is equal to ARG2
70
71
72 ARG1 != ARG2
73
74
75 ARG1 is unequal to ARG2
76
77
78 ARG1
79
80
81 ARG1 is greater than or equal to ARG2
82
83
84 ARG1
85
86
87 ARG1 is greater than ARG2
88
89
90 ARG1 + ARG2
91
92
93 arithmetic sum of ARG1 and ARG2
94
95
96 ARG1 - ARG2
97
98
99 arithmetic difference of ARG1 and ARG2
100
101
102 ARG1 * ARG2
103
104
105 arithmetic product of ARG1 and ARG2
106
107
108 ARG1 / ARG2
109
110
111 arithmetic quotient of ARG1 divided by ARG2
112
113
114 ARG1 % ARG2
115
116
117 arithmetic remainder of ARG1 divided by ARG2
118
119
120 STRING : REGEXP
121
122
123 anchored pattern match of REGEXP in STRING
124
125
126 match STRING REGEXP
127
128
129 same as STRING : REGEXP
130
131
132 substr STRING POS LENGTH
133
134
135 substring of STRING, POS counted from 1
136
137
138 index STRING CHARS
139
140
141 index in STRING where any CHARS is found, or 0
142
143
144 length STRING
145
146
147 length of STRING
148
149
150 quote TOKEN
151
152
153 interpret TOKEN as a string, even if it is a
154
155
156 keyword like `match' or an operator like `/'
157
158
159 ( EXPRESSION )
160
161
162 value of EXPRESSION
163
164
165 Beware that many operators need to be escaped or quoted for
166 shells. Comparisons are arithmetic if both ARGs are numbers,
167 else lexicographical. Pattern matches return the string
168 matched between and ) or null; if and ) are not used, they
169 return the number of characters matched or 0.
170
171
172 __expr exits with:__
173
174
175 0 if the expression is neither null nor 0; 1 if the
176 expression is null or 0; or 2 for invalid
177 expressions.
178 !!AUTHOR
179
180
181 Written by Mike Parker.
182 !!REPORTING BUGS
183
184
185 Report bugs to
186 !!COPYRIGHT
187
188
189 Copyright 2000 Free Software Foundation, Inc.
190 This is free software; see the source for copying
191 conditions. There is NO warranty; not even for
192 MERCHANTABILITY or FITNESS FOR A PARTICULAR
193 PURPOSE.
194 !!SEE ALSO
195
196
197 The full documentation for __expr__ is maintained as a
198 Texinfo manual. If the __info__ and __expr__ programs
199 are properly installed at your site, the
200 command
201
202
203 __info expr__
204
205
206 should give you access to the complete manual.
207 ----
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.