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
make
command, it will ask for password, since it installs thensh
in/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
,install
andclean
.build
andinstall
are 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/nsh
entry.
- 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.h
andcommand.c
files.
- The shell tries to mimic the
bash
shell grammar. - It has
simple commands
implemented - It has
I/O Redirections
implemented - It has
Pipes and Pipelines
implemented - It supports
cd
- Supports
tab-completion for filenames
andhistory
andup-arrow-key command history
- It does not support
compound commands
,lists/pipeline lists
andshell scripting
- It does not support
shell environment and variables
.