File: expr.1

package info (click to toggle)
manpages-ja 0.5.0.0.20100315-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 21,156 kB
  • ctags: 1
  • sloc: sh: 13,935; perl: 157; makefile: 114
file content (182 lines) | stat: -rw-r--r-- 5,424 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
.\" You may copy, distribute and modify under the terms of the LDP General
.\" Public License as specified in the LICENSE file that comes with the
.\" gnumaniak distribution
.\"
.\" The author kindly requests that no comments regarding the "better"
.\" suitability or up-to-date notices of any info documentation alternative
.\" is added without contacting him first.
.\"
.\" (C) 1999-2002 Ragnar Hojland Espinosa <ragnar@ragnar-hojland.com>
.\"
.\"     GNU expr man page
.\"     man pages are NOT obsolete!
.\"     <ragnar@ragnar-hojland.com>
.\"
.\" Japanese Version Copyright (c) 2000 NAKANO Takeo all rights reserved.
.\" Translated Sun 12 Mar 2000 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
.\" Updated & Modified Sat Jan 24 13:37:04 JST 2004
.\"         by Yuichi SATO <ysato444@yahoo.co.jp>
.\"
.\"WORD:	token			ȡ
.\"WORD:	operand			ڥ
.\"WORD:	null (character)	ʥ(ʸ)
.\"WORD:	operator		黻
.\"WORD:	subexpression		ɽ
.\"
.TH expr 1 "18 June 2002" "GNU Shell Utilities 2.1"
.SH ̾
expr \- ɾ
.SH 
.BI "expr " expression...
.sp
.B expr [\-\-help] [\-\-version]
.br
.SH 
.B expr
ϼɾη̤ɸϤ˽񤭽Ф
Υȡ (token) Ϥ줾̡ΰͿɬפ롣
.P
ڥ (operand) ϿޤʸǤ롣
.B expr
ϥڥɤΰ֤˸줿Τ򡢤ФƹԤ黻˱
ޤʸѴ롣
ʸ
.B expr
ǤϥȤʤƤ褤
뤫ݸ뤿ΰ䤬ɬפ⤷ʤ (ڡʤ)
.P
黻Ҥ 2 ֤륷ܥȤơ
ޤ֤륭ɤȤͿ롣
̤̾Τ褦˥롼ײѤǤ
(ˤ򤱤뤿ˤϳ̤򥯥ȤʤФʤʤ)
.P
.B expr
ϰʲνλơ֤:
.br
0: ʥǤ 0 Ǥʤ
.br
1: ʥޤ 0
.br
2: ʤ
.SH 黻 (ͥٽ)
.SS ط黻
.IP "\fB|\fP"
बʥǤ 0 Ǥʤк֤
ʥ 0 äϱ֤
̾ `or' 黻ˤ롣
.IP "\fB&\fP"
ࡢȤʥǤ 0 Ǥʤк֤
ʳξ 0 Ȥʤ롣
.IP "\fB<\fP\0 \fB<=\fP\0 \fB=\fP\0 \fB==\fP\0 \fB!=\fP\0 \fB>=\fP\0 \fB>\fP"
ξӤطʤ 1ʤ 0 ֤
(\fI==\fP  \fI=\fPƱˡ
\fBexpr\fP ϤޤξιͤѴ
ŪӤԤȤ롣
ɤ餫ΰͤѴǤʤäϼŪӤԤ
.SS ͱ黻
.IP "\fB+\fP\0 \fB-\fP"
ŪʲøԤ
ιϿͤѴ졢Ԥϥ顼Ȥʤ롣
.IP "\fB*\fP\0 \fB/\fP\0 \fB%\fP"
Ūʾ軻;黻Ԥ
(`%'  C ξƱ;黻б)
ιϿͤѴ졢˼Ԥϥ顼Ȥʤ롣
.SS ʸ黻
.IP "\fIstring\fP \fB:\fP \fIregex\fP"
ѥޥå¹Ԥ롣
ιʸѴ졢
 (\fBgrep\fP(1) λȤŪ) ɽȤư롣
ˤϰۤΤƬ `^' ưŪղä졢
बɽ˥ޥå뤫ΥƥȤԤ롣

ޥå硢
ɽΰ `\e('  '\e)' ǰϤƤС
\fB:\fP 黻Ҥ \fIstring\fP Τ
ɽ (subexpression) ˥ޥåʬ֤
ʳξϥޥåʬʸ֤롣

ޥå˼Ԥ硢
`\e('  `\e)' ȤƤˤϥʥʸ󤬡
Ǥʤˤ 0 ֤롣

`\e('  `\e)' ΥڥΤǽΤΤ֤ͤ˱ƶ롣
ʳΥڥϡɽα黻Ҥ򥰥롼ײȤ̣ġ

¾
.B expr
Ȱۤʤꡢ`+' (1 İʾ)`?' (0 ޤ 1)`|'
(or ³) ޥå󥰱黻ҤȤǧ롣
.TP
ˡʲΥɤǧ:
.TP
.BI index " string charset"
\fIcharset\fP ˤɤ줫ʸ \fIstring\fP ˸դС
κǽ˸դä֤֤ɤʸ⸫դʤ 0 ֤
.TP
.BI length " string"
\fIstring\fP Ĺ֤
.TP
.BI match " string regex"
ѥޥåԤ̤Τ
 ``\fIstring\fP \fB:\fP \fIregex\fP'' Ʊ
.TP
.BI quote " string"
\fIstring\fP  (黻ҤޤϥɤޤޤƤƤ) ̾ʸȤߤʤ
Ķѿ \fBPOSIXLY_CORRECT\fR ꤵƤ̵ˤʤ롣
.TP
.BI substr " string position length"
\fIstring\fP ʬʸ֤
ʬʸ \fIstring\fP  \fIposition\fP Ϥޤꡢ
 \fIlength\fP Ĺġ
\fIposition\fP  \fIlength\fP ǤʤäͤǤʤäϡ
ʥʸ֤
.PP
̤̾Υ롼ײΰ̣Ѥ뤳ȤǤ롣
 (match, substr, index, length) ʸȤѤ뤳ȤϤǤʤ
.SH ץ
GNU
.B expr
 1 Ĥǵư줿ˤϡ
ʲΥץǧ:
.TP
.B "\-\-help"
ɸϤ˻ˡΥåϤェλ롣
.TP
.B "\-\-version"
ɸϤ˥СϤェλ롣
.SH 
.PP
ѿ
.I foo
 1 ä:
.IP
foo=\`expr $a + 1\`
.PP
ѿ
.IR bar
˳ǼƤե̾Τ
ǥ쥯ȥʳʬɽ
.RI ( bar
ͤˤ `/' ޤޤƤʤƤɤ):
.IP
expr $bar : \'.*/\e(\^.*\e)\' \'\^|\' $a
.PP
ʸ `abc' ʸ `b' ޥå:
.IP
expr abc : 'a\e(.\e)c'
.PP
ʸ `abcdef'  `c' ޤ `z' Τ줫¸ߤƤ֤õ:
.IP
expr index abcdef cz
.PP
 (index) ʸȤѤƤä:
.IP
expr index index a
.PP
 (index) ʸȤѤƤ:
.IP
expr index quote index d
.SH 
ץΥХˤĤƤ bug-sh-utils@gnu.org 𤷤Ƥ
ڡι Ragnar Hojland Espinosa
<ragnar@ragnar-hojland.com> ԤäƤޤ