builtin(1) 맨 페이지 - 윈디하나의 솔라나라

개요

섹션
맨 페이지 이름
검색(S)

builtin(1)

builtin(1)                       User Commands                      builtin(1)

NAME
       builtin - ksh built-in function to add, delete, or display shell built-
       ins

SYNOPSIS
       builtin [-ds] [-f lib] [pathname ...]

DESCRIPTION
       The  ksh   builtin command adds, deletes, or displays built-in commands
       in the current shell environment. A built-in command  executes  in  the
       current  shell  process and can have side effects in the current shell.
       On most systems, the invocation time for built-in commands  is  one  or
       two  orders  of  magnitude  less  than  commands that create a separate
       process.


       For each pathname specified, the basename of  the  pathname  determines
       the  name  of  the built-in. For each basename, the shell looks for a C
       level function in the current shell whose name is  determined  by  pre-
       pending  b_  to the built-in name. If pathname contains a forward slash
       (/), the built-in is bound to pathname. A built-in bound to a  pathname
       is  only  executed  if  pathname is the first executable found during a
       path search. Otherwise, built-ins are found  prior  to  performing  the
       path search.


       If  pathname  is  not  specified,  builtin displays the current list of
       built-ins, or just the special built-ins if the -s option is specified,
       on standard output. The full pathname for built-ins that are  bound  to
       pathnames are displayed.


       Libraries  containing built-ins can be specified with the -f option. If
       the library contains a function named lib_init(), this function is  in‐
       voked  with argument 0 when the library is loaded. The lib_init() func‐
       tion can load built-ins by invoking an appropriate C level function. In
       this case there is no restriction on the C level function name.


       The C level function is invoked with three arguments. The first two are
       the same as main() and the third one is a pointer.


       The ksh  builtin command cannot be invoked from a restricted shell.

OPTIONS
       The following options are supported:

       -d        Delete each of the  specified  built-ins.  Special  built-ins
                 cannot be deleted.


       -f lib    On  systems  with dynamic linking, load and search for built-
                 ins in the shared library, lib.

                 Libraries are searched for in $PATH and system dependent  li‐
                 brary directories. The system dependent shared library prefix
                 or  suffix can be omitted. Once a library is loaded, its sym‐
                 bols become available for the current and subsequent  invoca‐
                 tions  of  builtin.  Multiple libraries can be specified with
                 separate invocations of builtin. Libraries  are  searched  in
                 the reverse order in which they are specified.


       -s        Display only the special built-ins.


OPERANDS
       The following operands are supported:

       pathname    Specifies the pathname. The basename of the pathname deter‐
                   mines the name of the built-in.


EXIT STATUS
       The following exit values are returned:

       0     Successful completion.


       >0    An error occurred.


EXAMPLES
       Example 1 Loading a builtin Command



       The  following  example  loads a builtin command mycmd from the library
       libfoo.so:




         example% builtin -f foo mycmd




AUTHORS
       David Korn, dgk@research.att.com

ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:

       tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE  TYPEAT‐
       TRIBUTE  VALUE _ Availabilitysystem/core-os _ Interface StabilityUncom‐
       mitted


SEE ALSO
       ksh(1), whence(1), attributes(7)

Oracle Solaris 11.4               1 May 2007                        builtin(1)
맨 페이지 내용의 저작권은 맨 페이지 작성자에게 있습니다.
RSS ATOM XHTML 5 CSS3