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
|
.\" This file documents the GNU shell utilities.
.\"
.\" Copyright (C) 1994 Free Software Foundation, Inc.
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of
.\" this manual under the conditions for verbatim copying, provided that
.\" the entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one.
.\"
.\" Permission is granted to copy and distribute translations of this
.\" manual into another language, under the above conditions for modified
.\" versions, except that this permission notice may be stated in a
.\" translation approved by the Foundation.
.\"
.\" Japanese Version Copyright (c) 1997 NAKANO Takeo all rights reserved.
.\" Translated Thu May 12 1997 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
.\"
.\"WORD: lexicographic Ū
.\"
.TH EXPR 1 "GNU Shell Utilities" "FSF" \" -*- nroff -*-
.SH ̾
expr \- ɾ
.SH
.B expr
expression...
.br
.B expr
{\-\-help,\-\-version}
.br
.SH
ʸϤ⤦ƥʥƤʤΤǡΡԴ
ʲǽ롣ߤ texinfo ʸʾȤʤäƤ롣
.PP
Υޥ˥奢ڡ GNU
.BR expr
ˤĤƵҤΤǤ롣
.B expr
ϼɾƤη̤ɸϤ˽ФΥȡϤ줾ʬΥ
ǰϤɬפ롣ڥɤϿʸǤ롣ʸ
.B expr
ǤϥȤʤƤ褤뤫ݸ뤿ΰ䤬ɬפ⤷
ʤ
.B expr
Υڥɤΰ֤֤줿ΤϡΥڥɤФ黻˱
ͤޤʸȤߤʤ롣
.PP
黻Ҥϰʲ̤ͥ٤ι⤤:
.IP "\fI|\fP"
ब̥Ǥ 0 Ǥʤк֤̥ 0 äϱ
̾ `or' 黻Ǥ롣
.IP "\fI&\fP"
ࡢȤ̥Ǥ 0 Ǥʤк֤ʳξ 0
ʤ롣
.IP "\fI<\fP\0 \fI<=\fP\0 \fI=\fP\0 \fI==\fP\0 \fI!=\fP\0 \fI>=\fP\0 \fI>\fP"
ξӤطʤ 1ʤ 0 ֤\fI==\fP \fI=\fP
Ʊˡ
\fBexpr\fP ϤޤξιͤȤߤʤͥǡȤƤӤԤ
Ȥ롣˼ԤϡŪӤԤ
.IP "\fI+\fP\0 \fI-\fP"
黻ԤιϿͤȤߤʤ졢Ԥϥ顼Ȥʤ롣
.IP "\fI*\fP\0 \fI/\fP\0 \fI%\fP"
黻Ԥ`%' C ξƱ;黻бˡι
ϿͤȤߤʤ졢˼Ԥϥ顼Ȥʤ롣
.IP "\fI:\fP"
ѥޥå¹Ԥ롣ιʸǤȤߤʤ졢
ɽȤư롣ˤϰۤΤƬ `^' ưŪղä졢
बɽ˥ޥå뤫ΥƥȤԤ롣ޥå
硢ɽΰ `\e(' '\e)' ǰϤƤˤϤʬ
.I :
֤ͤȤʤꡢʳξϥޥåʬʸ֤롣ޥ
˼Ԥ硢 `\e(' `\e)' ȤƤˤϥ̥ʸ
Ǥʤˤ 0 ֤롣 `\e(' `\e)' ΥڥϰĤ
ȤǤʤ
.TP
ˡʲΤ褦ʥɤǧ:
.TP
.BI match " string regex"
ѥޥåԤ̤Τ
``\fIstring\fP \fB:\fP \fIregex\fP'' Ʊ
.TP
.BI substr " string position length"
\fIstring\fP ʬʸ֤ʬʸ \fIstring\fP
\fIposition\fP Ϥޤꡢ \fIlength\fP Ĺġ
\fIposition\fP ޤ \fIlength\fP 餫Ͱʳξϡ̥ʸ
֤롣
.TP
.BI index " string character-class"
\fIstring\fP Τ\fIcharacter-class\fP Τɤ줫ʸĤ
ǽΰ֤֤ \fIstring\fP \fIcharacter-class\fP Τɤ
ʤä 0 ֤
.TP
.BI length " string"
.I string
Ĺ֤
.PP
̤ѤƱ黻롼ײ뤳ȤǤ롣ɤʸȤ
Ѥ뤳ȤϤǤʤ
.SS ץ
GNU
.B expr
ĤǼ¹Ԥ줿Ȥ˸¤ꡢʲΥץǧ:
.TP
.I "\-\-help"
Ȥ˴ؤåɸϤɽ¹֤ƽλ롣
.TP
.I "\-\-version"
СɸϤɽ¹֤ƽλ롣
.SH
.PP
ѿ
.I a
1 äˤϰʲΤ褦ˤ:
.IP
a=\`expr $a + 1\`
.PP
ʲѿ
.IR a
äƤե̾Τǥ쥯ȥʳʬɽΤѤ
뤳ȤǤ롣
.IR a
`/' ޤޤƤʤƤɤ:
.IP
expr $a : \'.*/\e(\^.*\e)\' \'\^|\' $a
.LP
Υ饯ȤƤ뤳Ȥա
.PP
.B expr
Ͻλ˰ʲΤ褦֤ͤ
.PP
0: ̥Ǥ 0 Ǥʤä硣
.br
1: ̥ޤ 0 ä硣
.br
2: ʤä硣
|