[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Add a new internal command to BASH
From: |
Abhinandan |
Subject: |
Re: Add a new internal command to BASH |
Date: |
Fri, 23 May 2008 19:28:57 -0700 (PDT) |
Hi Thanks for the information will try it
Chet Ramey wrote:
>
> 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/
>
>
>
>
--
View this message in context:
http://www.nabble.com/Add-a-new-internal-command-to-BASH-tp17400196p17443769.html
Sent from the Gnu - Bash mailing list archive at Nabble.com.