From 9516afb70a49bdf522885e8c31df894b0f8a5ef0 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sun, 12 Sep 2004 17:37:42 +0000 Subject: [PATCH] Added `-c' option to execute a command line. Should work, but doesn't always do. More often than not one gets page faults. As it happens sometimes even before anything meaty has been done at all (e.g. in main()->init_statements()->shell_var_set_text()-> shell_value_init_text()->malloc()), I believe that's a problem not caused by me. And I wasn't able to track it down. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8924 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/apps/shell/args.c | 43 ++++++++++++++++++++++++------------ src/kernel/apps/shell/args.h | 1 + src/kernel/apps/shell/main.c | 6 +++++ 3 files changed, 36 insertions(+), 14 deletions(-) diff --git a/src/kernel/apps/shell/args.c b/src/kernel/apps/shell/args.c index 5a33ac2301..f670e6204f 100644 --- a/src/kernel/apps/shell/args.c +++ b/src/kernel/apps/shell/args.c @@ -3,6 +3,7 @@ #include #include #include +#include #include "args.h" #include "shell_defs.h" @@ -10,18 +11,16 @@ bool af_exit_after_script; char *af_script_file_name; +char *gCommandToExecute = NULL; +static const char *kUsage = +"Usage: shell [ -s ] [ -c ] [