help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] Help to add new builtin


From: Joaquin Manuel Crespo
Subject: Re: [Help-bash] Help to add new builtin
Date: Thu, 8 Aug 2019 10:29:10 -0300

Great, thank you Greg.
For finish this, in the last case (add new builtin) when I create the
".def" file in "bash-[version]/builtins" and then the respective entries in
"Makefile.in", Must I edit or add some more in another source file or when
bash is compiled will add/link all object files that are under the same
directory?

El jue., 8 de ago. de 2019 a la(s) 10:22, Greg Wooledge (address@hidden)
escribiĆ³:

> On Thu, Aug 08, 2019 at 10:09:33AM -0300, Joaquin Manuel Crespo wrote:
> > Thank you a lot for the tip.
> > One question, since "enable" load the program as a builtin into bash
> > (excluding that in builtin the same is executed in the same ram space as
> > the shell and by the shell) in this case, What is the advantage of use
> > "enable" instead of execute the program in another child PID putting the
> > program in the "PATH" variable? Regardless the minimal difference of
> speed.
>
> In addition to the speed boost, builtins have access to your variables
> (both reading and writing), they can change your working directory,
> they can open or close file descriptors, etc.  All of these changes
> would affect the current shell process, rather than being isolated in
> a child process.
>
> > I would like integrate my programs directly into the source code, instead
> > of storage in another folder the programs or/and put the "enable" builtin
> > in "/etc/bash.bashrc"
>
> OK, in that case, pick one of the existing bash builtins to use as a
> model, and make your new builtin do the same things that the old one
> does.
>


-- 
Un cordial saludo.

*JoaquĆ­n Manuel Crespo.*

Gnu/Linux SysAdmin / C developper


reply via email to

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