help-bash
[Top][All Lists]
Advanced

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

[Help-bash] Writing custom builtins


From: Samadi van Koten
Subject: [Help-bash] Writing custom builtins
Date: Tue, 16 Jan 2018 15:29:00 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2

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




reply via email to

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