1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 16:18:12 +00:00

Shell: Implement a very basic exec builtin

Other shells also support a number of other options with exec and
some have special behaviour when calling exec with no arguments except
redirections.

This PR only supports the basic case of replacing the Shell process
(or LibShell host process) with the provided command.
This commit is contained in:
William Marlow 2020-12-29 19:42:34 +00:00 committed by Andreas Kling
parent 50d24e4f98
commit 96cd04f2ba
3 changed files with 59 additions and 36 deletions

View file

@ -45,6 +45,7 @@
__ENUMERATE_SHELL_BUILTIN(cd) \
__ENUMERATE_SHELL_BUILTIN(cdh) \
__ENUMERATE_SHELL_BUILTIN(pwd) \
__ENUMERATE_SHELL_BUILTIN(exec) \
__ENUMERATE_SHELL_BUILTIN(exit) \
__ENUMERATE_SHELL_BUILTIN(export) \
__ENUMERATE_SHELL_BUILTIN(glob) \
@ -253,6 +254,8 @@ private:
void run_tail(RefPtr<Job>);
void run_tail(const AST::Command&, const AST::NodeWithAction&, int head_exit_code);
[[noreturn]] void execute_process(Vector<const char*>&& argv);
virtual void custom_event(Core::CustomEvent&) override;
#define __ENUMERATE_SHELL_BUILTIN(builtin) \