~ubuntu-branches/ubuntu/trusty/bash/trusty-security

« back to all changes in this revision

Viewing changes to examples/loadables/README

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-03-03 22:52:05 UTC
  • mfrom: (1.3.5) (2.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20140303225205-87ltrt5kspeq0g1b
Tags: 4.3-1ubuntu1
* Merge with Debian; remaining changes:
  - skel.bashrc:
    - Run lesspipe.
    - Enable ls aliases.
    - Set options in ll alias to -alF.
    - Define an alert alias.
    - Enabled colored grep aliases.
  - etc.bash.bashrc:
    - Add sudo hint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Some examples of ready-to-dynamic-load builtins.  Most of the
 
2
examples given are reimplementations of standard commands whose
 
3
execution time is dominated by process startup time.  The
 
4
exceptions are sleep, which allows you to sleep for fractions
 
5
of a second, finfo, which provides access to the rest of the
 
6
elements of the `stat' structure that `test' doesn't let you
 
7
see, and pushd/popd/dirs, which allows you to compile them out
 
8
of the shell.
 
9
 
 
10
All of the new builtins in ksh93 that bash didn't already have
 
11
are included here, as is the ksh `print' builtin.
 
12
 
 
13
The configure script in the top-level source directory uses the
 
14
support/shobj-conf script to set the right values in the Makefile,
 
15
so you should not need to change the Makefile.  If your system
 
16
is not supported by support/shobj-conf, and it has the necessary
 
17
facilities for building shared objects and support for the
 
18
dlopen/dlsyn/dlclose/dlerror family of functions, please make
 
19
the necessary changes to support/shobj-conf and send the changes
 
20
to bash-maintainers@gnu.org.
 
21
 
 
22
Loadable builtins are loaded into a running shell with
 
23
 
 
24
        enable -f filename builtin-name
 
25
 
 
26
enable uses a simple reference-counting scheme to avoid unloading a
 
27
shared object that implements more than one loadable builtin before
 
28
all loadable builtins implemented in the object are removed.
 
29
 
 
30
Many of the details needed by builtin writers are found in hello.c,
 
31
the canonical example.  There is no real `builtin writers' programming
 
32
guide'.  The file template.c provides a template to use for creating
 
33
new loadable builtins.
 
34
 
 
35
On Debian GNU/Linux systems, the bash headers are in /usr/include/bash.
 
36
The appropriate options are already set in the example Makefile.
 
37
 
 
38
basename.c      Return non-directory portion of pathname.
 
39
cat.c           cat(1) replacement with no options - the way cat was intended.
 
40
cut.c           cut(1) replacement.
 
41
dirname.c       Return directory portion of pathname.
 
42
finfo.c         Print file info.
 
43
getconf.c       POSIX.2 getconf utility.
 
44
getconf.h       Replacement definitions for ones the system doesn't provide.
 
45
head.c          Copy first part of files.
 
46
hello.c         Obligatory "Hello World" / sample loadable.
 
47
id.c            POSIX.2 user identity.
 
48
ln.c            Make links.
 
49
logname.c       Print login name of current user.
 
50
Makefile.in     Simple makefile for the sample loadable builtins.
 
51
mkdir.c         Make directories.
 
52
necho.c         echo without options or argument interpretation.
 
53
pathchk.c       Check pathnames for validity and portability.
 
54
print.c         Loadable ksh-93 style print builtin.
 
55
printenv.c      Minimal builtin clone of BSD printenv(1).
 
56
push.c          Anyone remember TOPS-20?
 
57
README          README
 
58
realpath.c      Canonicalize pathnames, resolving symlinks.
 
59
rmdir.c         Remove directory.
 
60
sleep.c         sleep for fractions of a second.
 
61
strftime.c      Loadable builtin interface to strftime(3).
 
62
sync.c          Sync the disks by forcing pending filesystem writes to complete.
 
63
tee.c           Duplicate standard input.
 
64
template.c      Example template for loadable builtin.
 
65
truefalse.c     True and false builtins.
 
66
tty.c           Return terminal name.
 
67
uname.c         Print system information.
 
68
unlink.c        Remove a directory entry.
 
69
whoami.c        Print out username of current user.