Skip to content

A simple UNIX command line interpreter written in C. Supports interactive and non-interactive modes, executes system commands, and mimics the behavior of /bin/sh.

Notifications You must be signed in to change notification settings

aaronGeb/simple_shell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐚 simple_shell

0x16. C - Simple Shell

A lightweight UNIX-style shell implemented in C—supports command execution, arguments, built-ins, and environmental variables. Ideal for learning process control, system calls, and shell fundamentals

A lightweight UNIX-style shell implemented in C—supports command execution, arguments, built-ins, and environmental variables. Ideal for learning process control, system calls, and shell fundamentals.

Learning Objectives:bulb:

What you should learn from this project:

  • Who designed and implemented the original Unix operating system
  • Who wrote the first version of the UNIX shell
  • Who invented the B programming language (the direct predecessor to the C programming language)
  • Who is Ken Thompson
  • How does a shell work
  • What is a pid and a ppid
  • How to manipulate the environment of the current process
  • What is the difference between a function and a system call
  • How to create processes
  • What are the three prototypes of main
  • How does the shell use the PATH to find the programs
  • How to execute another program with the execve system call
  • How to suspend the execution of a process until one of its children terminates
  • What is EOF / “end-of-file”?
  • Write a beautiful code that passes the Betty checks
  • Write a UNIX command line interpreter
  • Handle command lines with arguments
  • Handle the PATH
  • Implement the exit built-in, that exits the shell
  • Implement the env built-in, that prints the current environment
  • Write your own getline function
  • You are not allowed to use strtok
  • handle arguments for the built-in exit
  • Implement the setenv and unsetenv builtin commands
  • Implement the builtin command cd
  • Handle the commands separator ;
  • Handle the && and || shell logical operators
  • Implement the alias builtin command
  • Handle variables replacement - Handle the $? variable - Handle the $$ variable
  • Handle comments (#)
  • Your shell can take a file as a command line argument

About

A simple UNIX command line interpreter written in C. Supports interactive and non-interactive modes, executes system commands, and mimics the behavior of /bin/sh.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages