Skip to content

π•π•–π• π•œπ•šπ•ž & π•Šπ•–π•¦π•Ÿπ•˜π• π•™'𝕀 π•„π•šπ•Ÿπ•š π•Šπ•™π•–π•π• πŸ–₯πŸ’½

Notifications You must be signed in to change notification settings

tmddms927/Mini-Shell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

π•π•–π• π•œπ•šπ•ž & π•Šπ•–π•¦π•Ÿπ•˜π• π•™'𝕀 π•„π•šπ•Ÿπ•š π•Šπ•™π•–π•π• πŸ’»

: Make a simple shell (bash)

builtins

  1. echo with option -n
  2. cd with only a relative or absolute path
  3. pwd with no options
  4. export with no options
  5. unset with no options
  6. env with no options or arguments
  7. exit with no options

functions

  1. Show a prompt when waiting for a new command.
  2. Have a working History.
  3. Search and launch the right executable (based on the PATH variable or by using relative or absolute path)
  4. ' inhibit all interpretation of a sequence of characters.
  5. " inhibit all interpretation of a sequence of characters except for $.
  6. Redirections:
  • < should redirect input.
  • should redirect output.

  • β€œ<<” read input from the current source until a line containing only the delimiter is seen. it doesn’t need to update history!
  • β€œ>>” should redirect output with append mode.
  1. Pipes | The output of each command in the pipeline is connected via a pipe to the input of the next command.
  2. Environment variables ($ followed by characters) should expand to their values.
  3. $? should expands to the exit status of the most recently executed foreground pipeline.
  4. ctrl-C ctrl-D ctrl-\ should work like in bash.
  5. When interactive:
  • ctrl-C print a new prompt on a newline.
  • ctrl-D exit the shell.
  • ctrl-\ do nothing.

Compiling

Run make.

Running

  1. start shell
./minishell
  1. test examples
echo -n hello
env
export a=aaaa
echo aaaa > a > b
echo a | echo b | ls
cat
echo $?

About

π•π•–π• π•œπ•šπ•ž & π•Šπ•–π•¦π•Ÿπ•˜π• π•™'𝕀 π•„π•šπ•Ÿπ•š π•Šπ•™π•–π•π• πŸ–₯πŸ’½

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published