Samadi van Koten
2018-01-16 15:29:00 UTC
Hi,
I'm in the process of trying to write some builtins for Bash. I've
installed the bash-builtins Debian package and used its headers to write
a few simple tests, but my latest experiment is proving rather more
difficult: I'd like to write a builtin that runs other bash commands,
which could be builtins, functions or executables.
Through browsing the source, I've managed to unearth the
"execute_command" function from "execute_cmd.h", but this is not
included in the headers provided by bash-builtins. It's possible I could
declare it in my source file, but I've not tried yet because I'm
struggling to figure out how to create a COMMAND which it needs as an
argument. There is (also not in the bash-builtins headers) a function
which creates a COMMAND from a SIMPLE_COM, which looks a little easier
to create, but it's still not the easiest thing I've seen.
Any advice or examples would be greatly appreciated.
Regards,
Samadi van Koten
I'm in the process of trying to write some builtins for Bash. I've
installed the bash-builtins Debian package and used its headers to write
a few simple tests, but my latest experiment is proving rather more
difficult: I'd like to write a builtin that runs other bash commands,
which could be builtins, functions or executables.
Through browsing the source, I've managed to unearth the
"execute_command" function from "execute_cmd.h", but this is not
included in the headers provided by bash-builtins. It's possible I could
declare it in my source file, but I've not tried yet because I'm
struggling to figure out how to create a COMMAND which it needs as an
argument. There is (also not in the bash-builtins headers) a function
which creates a COMMAND from a SIMPLE_COM, which looks a little easier
to create, but it's still not the easiest thing I've seen.
Any advice or examples would be greatly appreciated.
Regards,
Samadi van Koten