πππ πππ & πππ¦πππ π'π€ ππππ πππππ π»
: Make a simple shell (bash)
- 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
- Show a prompt when waiting for a new command.
- Have a working History.
- Search and launch the right executable (based on the PATH variable or by using relative or absolute path)
- ' inhibit all interpretation of a sequence of characters.
- " inhibit all interpretation of a sequence of characters except for $.
- Redirections:
- < should redirect input.
-
should redirect output.
- β<<β read input from the current source until a line containing only the delimiter is seen. it doesnβt need to update history!
- β>>β should redirect output with append mode.
- Pipes | The output of each command in the pipeline is connected via a pipe to the input of the next command.
- Environment variables ($ followed by characters) should expand to their values.
- $? should expands to the exit status of the most recently executed foreground pipeline.
- ctrl-C ctrl-D ctrl-\ should work like in bash.
- When interactive:
- ctrl-C print a new prompt on a newline.
- ctrl-D exit the shell.
- ctrl-\ do nothing.
Run make
.
- start shell
./minishell
- test examples
echo -n hello
env
export a=aaaa
echo aaaa > a > b
echo a | echo b | ls
cat
echo $?