bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Add a new internal command to BASH


From: Chet Ramey
Subject: Re: Add a new internal command to BASH
Date: Fri, 23 May 2008 12:09:14 -0400
User-agent: Thunderbird 2.0.0.14 (Macintosh/20080421)

Abhinandan wrote:
Hi i wanted to add a new internal command to bash, how shall i do it. please
help me out on this, trying to do this since many days. i'm not looking for
any alias etc stuffs, i want to my own command as bash built in commands
like trap, eval etc

Adding a builtin is an interesting learning exercise, at least.

Bash builtins are written as `.def' files and preprocessed into the form
the shell needs by the `mkbuiltins' program.

Adding a shell builtin is as simple as creating a `.def' file in the
appropriate format (use the existing ones as an example), putting it
in the `builtins' subdirectory, adding the name of the source file to
the appropriate variables (DEFSRC) in builtins/Makefile.in, adding
the corresponding object file name to the OFILES variable in the same
file, typing `make Makefiles' from the top-level bash build directory,
and rebuilding bash.

The first step is probably the hardest one.

Chet

--
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]