연산자

2014.03.23 21:12

소울 조회 수:7508

연산자 종류

Bourne Shell

Korn Shell

C Shell

 

숫자

-lt

<

<

(number only)

-gt

>

>

 

-le

<=

<=

 

-ge

>=

>=

숫자 or

-eq

==

==

문자열

-ne

!=

!=

 

문자열

=

=

=~ matches

 

(string only)

!=

!=

!~ does not match

논리연산자

-a(and)

&&

&&

(logical operator)

-o(or)

||

||

 

!(not)

산술연산자

(Arithmetic Operator)

+,-,*,/,%(mode)

mode 연산자는 몫을 버리고 나머지는 취함

치환연산자

=

(Assignment Operator)

 

 

+=,-=,*=,/=,%=,++,--

비트연산자

and

&

&

(Bitwise Operator)

exclusive or

^

^

 

or

|

|