1builtin(1) User Commands builtin(1)
2
3
4
6 builtin - ksh93 built-in function to add, delete, or display shell
7 built-ins
8
10 builtin [-ds] [-f lib] [pathname ...]
11
12
14 The ksh93 builtin command adds, deletes, or displays built-in commands
15 in the current shell environment. A built-in command executes in the
16 current shell process and can have side effects in the current shell.
17 On most systems, the invocation time for built-in commands is one or
18 two orders of magnitude less than commands that create a separate
19 process.
20
21
22 For each pathname specified, the basename of the pathname determines
23 the name of the built-in. For each basename, the shell looks for a C
24 level function in the current shell whose name is determined by pre-
25 pending b_ to the built-in name. If pathname contains a forward slash
26 (/), the built-in is bound to pathname. A built-in bound to a pathname
27 is only executed if pathname is the first executable found during a
28 path search. Otherwise, built-ins are found prior to performing the
29 path search.
30
31
32 If pathname is not specified, builtin displays the current list of
33 built-ins, or just the special built-ins if the -s option is specified,
34 on standard output. The full pathname for built-ins that are bound to
35 pathnames are displayed.
36
37
38 Libraries containing built-ins can be specified with the -f option. If
39 the library contains a function named lib_init(), this function is
40 invoked with argument 0 when the library is loaded. The lib_init()
41 function can load built-ins by invoking an appropriate C level func‐
42 tion. In this case there is no restriction on the C level function
43 name.
44
45
46 The C level function is invoked with three arguments. The first two are
47 the same as main() and the third one is a pointer.
48
49
50 The ksh93 builtin command cannot be invoked from a restricted shell.
51
53 The following options are supported:
54
55 -d Delete each of the specified built-ins. Special built-ins
56 cannot be deleted.
57
58
59 -f lib On systems with dynamic linking, load and search for built-
60 ins in the shared library, lib.
61
62 Libraries are searched for in $PATH and system dependent
63 library directories. The system dependent shared library pre‐
64 fix or suffix can be omitted. Once a library is loaded, its
65 symbols become available for the current and subsequent invo‐
66 cations of builtin. Multiple libraries can be specified with
67 separate invocations of builtin. Libraries are searched in
68 the reverse order in which they are specified.
69
70
71 -s Display only the special built-ins.
72
73
75 The following operands are supported:
76
77 pathname Specifies the pathname. The basename of the pathname deter‐
78 mines the name of the built-in.
79
80
82 The following exit values are returned:
83
84 0 Successful completion.
85
86
87 >0 An error occurred.
88
89
91 Example 1 Loading a builtin Command
92
93
94 The following example loads a builtin command mycmd from the library
95 libfoo.so:
96
97
98 example% builtin -f foo mycmd
99
100
101
103 David Korn, dgk@research.att.com
104
106 See attributes(5) for descriptions of the following attributes:
107
108
109
110
111 ┌─────────────────────────────┬─────────────────────────────┐
112 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
113 ├─────────────────────────────┼─────────────────────────────┤
114 │Availability │SUNWcsu │
115 ├─────────────────────────────┼─────────────────────────────┤
116 │Interface Stability │Uncommitted │
117 └─────────────────────────────┴─────────────────────────────┘
118
120 ksh93(1), whence(1), attributes(5)
121
122
123
124SunOS 5.11 1 May 2007 builtin(1)