
644
|
Chapter 6: The Bash Shell and Korn Shell
This is the Title of the Book, eMatter Edition
Copyright © 2006 O’Reilly & Associates, Inc. All rights reserved.
Built-in Mathematical Functions (ksh93 only)
ksh93 provides access to the standard set of mathematical functions. They are
called using C function call syntax.
Examples
See the let command for more information and examples:
let "count=0" "i = i + 1" Assign i and count
let "num % 2" Test for an even number
(( percent >= 0 && percent <= 100 )) Test the range of a value
Command History
Both shells let you display or modify previous commands. Commands in the
history list can be modified using:
• Line-edit mode
• The fc and hist commands
Bash also supports a command-history mechanism very similar to that of the C
shell. Because the interactive line-editing features are considerably superior, and
because Bash’s command history is almost identical to that of the C shell, we have
|| Logical OR (short-circuit).
?: Inline conditional evaluation.
= += -= Assignment.
*= /= %=
<<= >>=
&= ^= |=
, Sequential expression evaluation.
a
In ksh93, the ** operator is right associative. In bashversions prior to 3.1, it is left associative. It will be changed to right
associative starting with version 3.1.
Name Function Name Function
abs Absolute value hypot Euclidean distance
acos Arc cosine int Integer part of floating-point number
asin Arc sine log Natural logarithm
atan