
640
|
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.
Arrays
Both shells support one-dimensional arrays. The first element is numbered 0. Bash
has no limit on the number of elements. ksh88 allowed up 1024 elements, early
versions of ksh93 allowed at least 4096 elements, and modern versions allow up
to 65,536 elements. Arrays are initialized with a special form of assignment:
message=(hi there how are you today) Bash and ksh93
where the specified values become elements of the array. The Korn shell has an
additional syntax:
set -A message hi there how are you today Ksh88 and ksh93
MAILCHECK=n Number of seconds between mail checks; default is 600 (10 minutes).
MAILPATH=files One or more files, delimited by a colon, to check for incoming mail. Along with
each file, you may supply an optional message that the shell prints when the file
increases in size. Messages are separated from the filename by a ? character, and
the default message is You havemail in $_. $_ is replaced with the name of the
file. For example, you might have:
MAILPATH="$MAIL?Ring! Candygram!:/etc/motd?New Login
Message"
OPTERR=n (B) When set to 1 (the default value), Bash prints error messages from the built-
in getopts command.
PATH=dirlist One or more pathnames, delimited by colons, in which to search for commands
to execute. Default ...