Simple implementation of Unix bash with pure C
- built-in commands
- echo with -n option
- cd with absolute or relative path
- pwd
- export
- unset
- env
- exit
- prompt depending on PS1 PS2 variables
- commands history
- redirects
- pipes
- evironment variables stored in the hashtable
- exit status $?
- signals
- ctrl-C
- ctrl-D
- ctrl-\
- && and ||
- wilcard * matching
there is a Makefile for compiling sources
to compile binary, you should run make
command
$ make
$ ./minishell
- pipes and child processes
minishell > ls -la | wc -l
13
minishell > yes | head -n 3
y
y
y
- redirects
minishell > < input.txt > output.txt cat
- wildcards
minishell > ls hash**t*le* | cat
hash.c
hashtable.c
hashtable_to_sorted_array.c
insert_hashtable.c
pair.c
- prompt
minishell > PS1="new_prompt > "
new_prompt >
- && and ||
minishell > echo -n "Hello, " && echo "world" || echo "!!!!!!!"
Hello, world