24.07.2018 Views

Bash-Beginners-Guide

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Constants with a leading 0 (zero) are interpreted as octal numbers. A leading "0x" or "0X" denotes<br />

hexadecimal. Otherwise, numbers take the form "[BASE'#']N", where "BASE" is a decimal number between<br />

2 and 64 representing the arithmetic base, and N is a number in that base. If "BASE'#'" is omitted, then base<br />

10 is used. The digits greater than 9 are represented by the lowercase letters, the uppercase letters, "@", and<br />

"_", in that order. If "BASE" is less than or equal to 36, lowercase and uppercase letters may be used<br />

interchangably to represent numbers between 10 and 35.<br />

Operators are evaluated in order of precedence. Sub-expressions in parentheses are evaluated first and may<br />

override the precedence rules above.<br />

Wherever possible, <strong>Bash</strong> users should try to use the syntax with square brackets:<br />

$[ EXPRESSION ]<br />

However, this will only calculate the result of EXPRESSION, and do no tests:<br />

franky ~> echo $[365*24]<br />

8760<br />

See Section 7.1.2.2, among others, for practical examples in scripts.<br />

3.4.7. Process substitution<br />

Process substitution is supported on systems that support named pipes (FIFOs) or the /dev/fd method of<br />

naming open files. It takes the form of<br />

(LIST)<br />

The process LIST is run with its input or output connected to a FIFO or some file in /dev/fd. The name of<br />

this file is passed as an argument to the current command as the result of the expansion. If the ">(LIST)" form<br />

is used, writing to the file will provide input for LIST. If the "

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!