Chapter 4: Shell Builtin Commands

53

specifying a full pathname, even though the shell normally searches for builtins before disk commands. If -n is used, the names become disabled. Otherwise names are enabled.

For example, to use the test binary found via $PATH instead of the shell builtin version, type ‘enable -n test’.

If the -p option is supplied, or no name arguments appear, a list of shell builtins is printed. With no other arguments, the list consists of all enabled shell builtins. The -a option means to list each builtin with an indication of whether or not it is enabled.

The -f option means to load the new builtin command name from shared object filename, on systems that support dynamic loading. The -d option will delete a builtin loaded with -f.

If there are no options, a list of the shell builtins is displayed. The -s option restricts enable to the posix special builtins. If -s is used with -f, the new builtin becomes a special builtin (see Section 4.4 [Special Builtins], page 68).

The return status is zero unless a name is not a shell builtin or there is an error loading a new builtin from a shared object. help help [-dms] [pattern]

Display helpful information about builtin commands. If pattern is specified, help gives detailed help on all commands matching pattern, otherwise a list of the builtins is printed.

Options, if supplied, have the following meanings:

-d

Display a short description of each pattern

-m

Display the description of each pattern in a manpage-like format

-s

Display only a short usage synopsis for each pattern

The return status is zero unless no command matches pattern. let let expression [expression ...]

The let builtin allows arithmetic to be performed on shell variables. Each expression is evaluated according to the rules given below in Section 6.5 [Shell

Arithmetic], page 87.

If the last expression evaluates to 0, let returns 1; otherwise 0 is returned. local local [option] name[=value] ...

For each argument, a local variable named name is created, and assigned value.

The option can be any of the options accepted by declare. local can only be used within a function; it makes the variable name have a visible scope restricted to that function and its children. The return status is zero unless local is used outside a function, an invalid name is supplied, or name is a readonly variable. logout