A Minimalist Linux Terminal Shell.
- Clone the repo and change directory:
git clone https://github.com/NJnisarg/nsh && cd nsh/ - Run the make script:
make - While running the
makecommand, it will ask for password, since it installs thenshin/bin/nsh. If you don't want that please, remove it from the Makefile. - To run the terminal:
nsh - The Makefile has 4 different targets:
all,build,installandclean.buildandinstallare ran internally byall. - To clean up everything, run
make clean. This command will also ask for sudo password since it attempts to remove the/bin/nshentry.
- The Terminal shell, has 2 major components: 1.) The Parser and 2.) The Executor
- The Parser component is built using Lex and Yacc and GNU Readline library, where as the executor is organized in the command.h and command.c files
- The Lex is used for getting a Tokenizer/scanner(lexical analyzer) and Yacc is used to get the Parser that parses the Grammar for the shell commands.
- The executor code and the data structures to hold the commands (Command table) are defined in the
command.handcommand.cfiles.
- The shell tries to mimic the
bashshell grammar. - It has
simple commandsimplemented - It has
I/O Redirectionsimplemented - It has
Pipes and Pipelinesimplemented - It supports
cd - Supports
tab-completion for filenamesandhistoryandup-arrow-key command history
- It does not support
compound commands,lists/pipeline listsandshell scripting - It does not support
shell environment and variables.