Logical, arithmetical and comparison operators



Logical, arithmetical and comparison operators


Up
Next
Previous
Logical, arithmetical and comparison operators
These operators are similar to those of C and have the same precedence.
They include


|| && | ^ & == != =~ !~ <= >=

< > << >> + - * / % ! ~ ( )


Here the precedence increases to the right, `==' `!=' `=~' and `!~', `<='
`>=' `<' and `>', `<<' and `>>', `+' and `-', `*' `/' and `%' being, in
groups, at the same level. The `==' `!=' `=~' and `!~' operators compare
their arguments as strings; all others operate on numbers. The operators
`=~' and `!~' are like `!=' and `==' except that the right hand side is a
glob-pattern (see Filename substitution) against which the left hand
operand is matched. This reduces the need for use of the switch
builtin command in shell scripts when all that is really needed is
pattern matching.

Strings which begin with `0' are considered octal numbers. Null or
missing arguments are considered `0'. The results of all expressions are
strings, which represent decimal numbers. It is important to note that
no two components of an expression can appear in the same word; except
when adjacent to components of expressions which are syntactically
significant to the parser (`&' `|' `<' `>' `(' `)') they should be
surrounded by spaces.

Up
Next
Previous



Wyszukiwarka

Podobne podstrony:
01 Stacks in Memory and Stack Operations
Translation and Comparative Literature Lefevere
Eliade, Mircea Psychology and Comparative Religion
logical and
language operators comparison
math Complex Numbers and Complex Arithmetic
DRAGNEA Slavic and Greek Roman Mythology, Comparative Mythology
Operation And Function Light Anti Armor Weapons M72 And M136
Calendar of Backyard Gardening Operations for Selected Temperate Fruit and Nut Trees
language operators arithmetic
Comparison of theoretical and experimental free vibrations of high industrial chimney interacting
Comparison of cartesian vector control and polar

więcej podobnych podstron