Skip to content

SuperStarKang/Minishell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minishell

Minishell is a simple shell implemented in C language, mimicking the functionality of the Bash shell. This minishell has implemented the following key features:

  1. Redirection Features
  • <: Input redirection
  • <<: Input redirection (here document)
  • >: Output redirection
  • >>: Output redirection (overwrite)
  1. Pipe Feature
  • |: Communication between commands using pipes
  1. Environment Variable Feature
  • $: Using environment variables
  1. Signal Handling Features
  • Ctrl+C: Program termination signal
  • Ctrl+D: EOF (End Of File) signal
  • Ctrl+: Quit signal
  1. Extended Echo Feature
  • Echo command with -n option to remove trailing newline character
  1. CD Command
  • Can only use relative or absolute paths
  1. PWD Command
  • Print the current working directory if no options are provided
  1. Export Command
  • Setting environment variables
  1. Unset Command
  • Removing environment variables
  1. Env Command
  • Print environment variables if no options or arguments are provided
  1. Exit Command
  • Exit the shell if no options or arguments are provided

Usage

  1. Run the minishell: ./minishell
  2. Input commands: You can input any Bash shell commands available.
  3. Exit: Use the exit command or Ctrl+D to exit the minishell.

Example

$ ./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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published