2008-12-14 12:55:46 +01:00
|
|
|
|
2021-06-12 23:34:41 +02:00
|
|
|
#define SHELL_VERSION "0.8.2"
|
2008-12-14 12:55:46 +01:00
|
|
|
|
2021-06-12 23:34:41 +02:00
|
|
|
char cmdline[256];
|
|
|
|
|
|
|
|
char tmpstr[64];
|
2008-12-14 12:55:46 +01:00
|
|
|
|
|
|
|
char title[64];
|
2017-02-10 18:36:03 +01:00
|
|
|
char cur_dir[FILENAME_MAX];
|
2008-12-14 12:55:46 +01:00
|
|
|
|
|
|
|
/// ===========================================================
|
|
|
|
|
|
|
|
char *ALIASES = NULL;
|
|
|
|
unsigned ALIAS_NUM = 0;
|
|
|
|
|
|
|
|
/// ===========================================================
|
|
|
|
|
2017-01-01 23:28:50 +01:00
|
|
|
#define CMD_HISTORY_NUM 11
|
2008-12-14 12:55:46 +01:00
|
|
|
|
2017-02-10 18:36:03 +01:00
|
|
|
char CMD[FILENAME_MAX * 2];
|
|
|
|
char CMD_HISTORY[CMD_HISTORY_NUM][FILENAME_MAX * 2];
|
2013-10-19 09:13:02 +02:00
|
|
|
char CMD_NUM = 0;
|
2012-06-04 14:54:51 +02:00
|
|
|
char CMD_HISTORY_NUM_REAL = 0;
|
2017-01-06 17:12:57 +01:00
|
|
|
unsigned LAST_PID = 0;
|
2008-12-14 12:55:46 +01:00
|
|
|
|
|
|
|
/// ===========================================================
|
|
|
|
|
|
|
|
char script_sign[] = {"#SHS"};
|
|
|
|
|
|
|
|
/// ===========================================================
|
|
|
|
|
2010-10-07 15:43:56 +02:00
|
|
|
int NUM_OF_CMD;
|
|
|
|
|
|
|
|
/// ===========================================================
|
2008-12-14 12:55:46 +01:00
|
|
|
|
2010-10-07 15:43:56 +02:00
|
|
|
typedef struct
|
2008-12-14 12:55:46 +01:00
|
|
|
{
|
2010-10-07 15:43:56 +02:00
|
|
|
const char* name;
|
|
|
|
const char* help;
|
|
|
|
const void* handler;
|
|
|
|
} command_t;
|
|
|
|
|
|
|
|
/// ===========================================================
|
2008-12-14 12:55:46 +01:00
|
|
|
|
2010-10-07 15:43:56 +02:00
|
|
|
int cmd_about(char arg[]);
|
|
|
|
int cmd_alias(char arg[]);
|
|
|
|
int cmd_cd(char dir[]);
|
|
|
|
int cmd_clear(char arg[]);
|
|
|
|
int cmd_date(char arg[]);
|
|
|
|
int cmd_echo(char text[]);
|
|
|
|
int cmd_exit(char arg[]);
|
2010-10-21 01:58:36 +02:00
|
|
|
int cmd_memory(char arg[]);
|
2010-10-07 15:43:56 +02:00
|
|
|
int cmd_help(char cmd[]);
|
|
|
|
int cmd_kill(char process[]);
|
2021-04-02 00:06:12 +02:00
|
|
|
int cmd_pkill(char process_name[]);
|
2010-10-07 15:43:56 +02:00
|
|
|
int cmd_ls(char dir[]);
|
|
|
|
int cmd_mkdir(char dir[]);
|
|
|
|
int cmd_more(char file[]);
|
|
|
|
int cmd_ps(char arg[]);
|
|
|
|
int cmd_pwd(char arg[]);
|
|
|
|
int cmd_reboot(char arg[]);
|
|
|
|
int cmd_rm(char file[]);
|
|
|
|
int cmd_rmdir(char dir[]);
|
|
|
|
int cmd_touch(char file[]);
|
|
|
|
int cmd_ver(char arg[]);
|
|
|
|
int cmd_sleep(char arg[]);
|
2010-10-21 06:37:59 +02:00
|
|
|
int cmd_shutdown(char arg[]);
|
2010-10-21 01:58:36 +02:00
|
|
|
int cmd_uptime(char param[]);
|
2010-10-24 16:32:14 +02:00
|
|
|
int cmd_killall(char process_name[]);
|
2012-06-04 14:54:51 +02:00
|
|
|
int cmd_history(char arg[]);
|
2021-06-12 23:34:41 +02:00
|
|
|
int cmd_kfetch(char param[]);
|
2013-02-16 12:25:37 +01:00
|
|
|
int cmd_cp(char param[]);
|
2020-04-16 23:50:49 +02:00
|
|
|
int cmd_mv(char param[]);
|
|
|
|
int cmd_ren(char param[]);
|
2017-01-06 17:12:57 +01:00
|
|
|
int cmd_waitfor(char param[]);
|
2010-10-07 15:43:56 +02:00
|
|
|
|
|
|
|
/// ===========================================================
|
|
|
|
|
2010-10-21 01:58:36 +02:00
|
|
|
#if LANG_ENG
|
|
|
|
#include "locale/eng/globals.h"
|
|
|
|
#elif LANG_RUS
|
|
|
|
#include "locale/rus/globals.h"
|
|
|
|
#endif
|
2008-12-14 12:55:46 +01:00
|
|
|
|
|
|
|
/// ===========================================================
|
2010-10-07 15:43:56 +02:00
|
|
|
|
|
|
|
|