To-do list. Vita:
Arch:
- norm (for now skip init.c, ft_cd.c, file_manager1.c, free_utils1.c)
(old)To-do list:
- Divide on logical groups/tokens (lexer thing);
- Check for errors in logical groups (for example syntax error, ”/’/) missing);
- Check tokens and word expansion (“...”, $VAR) (parser thing);
- Run command (execution thing):
4.1) If not a built-in command, we run the child process and execute command;
4.2) If it is a built-in command, we don’t run the child process but execute it in the parent one. - ???
- Profit.
Types of tokens:
- separator (all that is true for is_space());
- word/command (for example ls, cat e.t.c. “” counts as an empty string);
- field (‘...’);
- expandable field (“...”);
- redirection:
5.1) < should redirect input;
5.2) > should redirect output;
5.3) << should be given a delimiter, then read the input until a line containing the delimiter is seen. However, it doesn’t have to update the history;
5.4) >> should redirect output in append mode. - pipe (|);
- braces ((, ));
- dollar sign (to handle env variables (
$VAR) and $ ? for expanding the exit status of the most recently executed foreground pipeline); - if-and (&&) (bonus part);
- if-or (||) (bonus part).
Things to handle:
- Display a prompt when waiting for a new command;
- Have a working history;
- Search and launch the right executable (based on the PATH variable or using a relative or an absolute path);
- Avoid using more than one global variable to indicate a received signal
- ctrl-C displays a new prompt on a new line;
- ctrl-D exits the shell;
- ctrl-\ does nothing;
- Wildcards * (bonus part);
Built-ins:
- echo with option -n;
- cd with only a relative or absolute path;
- pwd with no options;
- export with no options;
- unset with no options;
- env with no options or arguments;
- exit with no options.