Minishell is a simple shell implemented in C language, mimicking the functionality of the Bash shell. This minishell has implemented the following key features:
- Redirection Features
- <: Input redirection
- <<: Input redirection (here document)
- >: Output redirection
- >>: Output redirection (overwrite)
- Pipe Feature
- |: Communication between commands using pipes
- Environment Variable Feature
- $: Using environment variables
- Signal Handling Features
- Ctrl+C: Program termination signal
- Ctrl+D: EOF (End Of File) signal
- Ctrl+: Quit signal
- Extended Echo Feature
- Echo command with -n option to remove trailing newline character
- CD Command
- Can only use relative or absolute paths
- PWD Command
- Print the current working directory if no options are provided
- Export Command
- Setting environment variables
- Unset Command
- Removing environment variables
- Env Command
- Print environment variables if no options or arguments are provided
- Exit Command
- Exit the shell if no options or arguments are provided
- Run the minishell: ./minishell
- Input commands: You can input any Bash shell commands available.
- Exit: Use the exit command or Ctrl+D to exit the minishell.
$ ./minishell
$ ls -l > output.txt
$ cat < input.txt | grep "pattern"
$ echo -n "Hello, World!"
$ cd /path/to/directory
$ export MY_VARIABLE=my_value
$ unset MY_VARIABLE
$ env
$ exit