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 OperationsTranslation and Comparative Literature LefevereEliade, Mircea Psychology and Comparative Religionlogical andlanguage operators comparisonmath Complex Numbers and Complex ArithmeticDRAGNEA Slavic and Greek Roman Mythology, Comparative MythologyOperation And Function Light Anti Armor Weapons M72 And M136Calendar of Backyard Gardening Operations for Selected Temperate Fruit and Nut Treeslanguage operators arithmeticComparison of theoretical and experimental free vibrations of high industrial chimney interactingComparison of cartesian vector control and polarwięcej podobnych podstron