g++ mini_shell.cpp
./a.out
- Environment variables
- Path functions
- Parsing
- Piping
- Input and Output redirection: Read mode Write mode Append mode
- USER, PATH, HOME, SHELL, TERM : environment variables
- cd : change directory to /home/user
- cd (some directory) : changes directory to the given directory
- history : to get all the input you've given before exit
- history exit : gets all the input you've given before exit and then exits from the shell
- exit (or) quit (or) x : exits from the shell
- (path functions) : e.g. ls
- (command1)|(command2) : piping and executing both commands
- (command)>(output.txt) : executes the command and outputs it to output.txt (write mode)
- (command)>>(output.txt) : executes the command and adds the output to output.txt (append mode)
- (command)<(input.txt) : executes the command using the input form input.txt (read mode)
- setenv (environment variable) = (new value) : sets new value for the given environment variable
- help : opens all the command and their syntax
(you don't actually have to put the paranthesis () as per the above explanation)
- Piping : type both the command with no space before and after the pipe symbol (|)
- Redirection : type both the command with no space before and after the redirection symbol (> , <, >>)
- At every stage you get an error message saying "wrong input" when you type some wrong input
- Do not include single or double quotes in any of the commands you type
- setenv : type command as setenv (environment variable) = (new value)
- only single piping and redirection