Skip to content

Instantly share code, notes, and snippets.

Add this to the end of kernel/test/kshell/kshell.c and declare it in the associated .h
int kshell_test(kshell_t *ksh,char *command)
{
char *args[10];
int argc = 0;
kshell_get_args(ksh, command, args, KSH_MAX_ARGS, &argc);
kshell_command_t *cmd;
if ((cmd = kshell_lookup_command(args[0], strlen(args[0]))) == NULL) {
kprintf(ksh, "kshell: %s not a valid command\n", args[0]);
@kcbarry
kcbarry / WeenixWorkaround
Last active December 16, 2015 20:29
A quick and dirty way to run commands on weenix without a terminal
Add this to the end of kernel/test/kshell/kshell.c and declare it in the associated .h
int kshell_test(kshell_t *ksh,char *command)
{
char *args[10];
int argc = 0;
char redirect_in[MAXPATHLEN];
char redirect_out[MAXPATHLEN];
int append;
redirect_in[0] = redirect_out[0] = '\0';