[Top][All Lists]

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

Re: Any guide about writing my own bash built-in commands?

From: Joachim Schmitz
Subject: Re: Any guide about writing my own bash built-in commands?
Date: Mon, 1 Feb 2010 14:25:13 +0100

Greg Wooledge wrote:
On Sat, Jan 30, 2010 at 03:17:22PM +0100, Joachim Schmitz wrote:
Clark J. Wang wrote:
Hi all,

I want to write my own built-in bash commands but I cannot find any
info about that in bash manual. Anyone has any idea?

Have a look into the .def files in the builtins directory of bash's
source tree.
Add your .def file (start with a copy of an existing one changed to
your needs), update Makefile (or better Maklefile.in) and you're
Did this myself to add a couple of platform specific builtins

There's another way.  You can build a loadable builtin function as a
single (shared) object file, and load it with "enable -f filename
name". I have some extremely brief documentation at

Looks like an excellent way of testing new builtins before making them permanent, thanks for the hint!
Thanks to Chris Jones for his hint too!

Once it's done and tested I'd prefer not to have it as a loadable builtin though, but a builtin builtin 8-)

Bye, Jojo

reply via email to

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