From 796e839f5f5e60be95f1c64f3784c3eef52673a7 Mon Sep 17 00:00:00 2001 From: Abdellah El Morabit Date: Fri, 31 Jan 2025 21:47:05 +0100 Subject: implementing basic functionality in the shell --- main.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'main.c') diff --git a/main.c b/main.c index 9609d00..b4f02ff 100644 --- a/main.c +++ b/main.c @@ -5,9 +5,34 @@ #include #include +/* BOOLEANS */ #define true 1 #define false 0 +/* SIGNALS */ +#define SIGHUP 1 /* Hang up the process */ +#define SIGINT 2 /* Interrupt the process */ +#define SIGQUIT 3 /* Quit the process */ +#define SIGILL 4 /* Illegal instruction. */ +#define SIGTRAP 5 /* Trace trap. */ +#define SIGABRT 6 /* Abort. */ + +void PIPELING(); +void COMMAND_EXECUTION(); +void REDIRECTION(); +void SCRIPTING(); + +void ERROR_QUIT(char *CURRENT_COMMAND, char *COMMAND_INSTRUCTIONS) +{ + printf("%s", ); + +} + +void err_sys(char *string) +{ + printf("%s", string); +} + void PROCESS_PID() { printf("PID %ld\n", (long)getpid()); @@ -20,7 +45,7 @@ void LIST_CURRENT_DIRECTORY(int argc, char *argv[]) if (argc != 2) err_quit("usage: ls directory_name"); if ((dp = opendir(argv[1])) == NULL) - err_sys( argv[1]); + err_sys(argv[1]); while ((dirp = readdir(dp)) != NULL) printf("%s\n", dirp->d_name); closedir(dp); -- cgit v1.2.3-70-g09d2