2014-02-10 15:28:55 +01:00
|
|
|
This application shows how to use own or the system shell commands. In order to use
|
2014-01-10 16:21:35 +01:00
|
|
|
the system shell commands:
|
|
|
|
|
2015-07-14 18:42:46 +02:00
|
|
|
1. Additionally to the module: shell, shell_commands,
|
2014-02-11 18:15:43 +01:00
|
|
|
the module for the corresponding system command is to include, e.g.
|
2014-02-10 15:28:55 +01:00
|
|
|
module ps for the ps command (cf. the Makefile in the application root
|
2014-02-11 18:15:43 +01:00
|
|
|
directory).
|
2015-07-14 18:42:46 +02:00
|
|
|
2. Start the shell like this:
|
|
|
|
2.1 reserve buffer:
|
|
|
|
char line_buf[SHELL_DEFAULT_BUFSIZE];
|
|
|
|
2.1a run shell only with system commands:
|
|
|
|
shell_run(NULL, line_buf, SHELL_DEFAULT_BUFSIZE);
|
|
|
|
2.1b run shell with provided commands in addition to system commands:
|
|
|
|
shell_run(shell_commands, line_buf, SHELL_DEFAULT_BUFSIZE);
|