![]() |
s i s t e m a o p e r a c i o n a l m a g n u x l i n u x | ~/ · documentação · suporte · sobre |
3.6. Operations and Related Topics3.6.1. Operations
The following are normally used in combination with expr or let. arithmetic operators
The bitwise logical operators seldom make an appearance in shell scripts. Their chief use seems to be manipulating and testing values read from ports or sockets. "Bit flipping" is more relevant to compiled languages, such as C and C++, which run fast enough to permit its use on the fly.
relational tests
3.6.2. Numerical ConstantsA shell script interprets a number as decimal (base 10), unless that number has a special prefix or notation. A number preceded by a 0 is octal (base 8). A number preceded by 0x is hexadecimal (base 16). A number with an embedded # is evaluated as BASE#NUMBER (this option is of limited usefulness because of range restrictions). Example 3-16. Representation of numerical constants:
|