
eval | 663
Bash and Korn
This is the Title of the Book, eMatter Edition
Copyright © 2006 O’Reilly & Associates, Inc. All rights reserved.
enable
enable [-adnps] [-f file] [command ...]
Bash only. Enable or disable shell built-in commands. Disabling a
built-in lets you use an external version of a command that would
otherwise use a built-in version, such as echo or test.
Options
-a For use with -p, print information about all built-in
commands, disabled and enabled.
-d Remove (delete) a built-in previously loaded with -f.
-f file
Load a new built-in command command from the shared
library file file.
-n Disable the named built-in commands.
-p Print a list of enabled built-in commands.
-s Print only the POSIX special built-in commands. When
combined with -f, the new built-in command becomes a
POSIX special built-in.
esac
esac
Reserved word that ends a case statement.
eval
eval args
Typically, eval is used in shell scripts, and args is a line of code that
contains shell variables. eval forces variable expansion to happen
first and then runs the resulting command. This “double-scanning”
is useful any time shell variables contain input/output redirection
symbols, aliases, or other shell variables. (For example, redirection
normally happens before variable expansion, so a variable
containing redirection symbols must be expanded first using eval;
otherwise, the redirection symbols remain uninterpreted.)
Example
This