Small Shell (smallsh)

Small Shell (smallsh)

At OSU, smallsh is something of a rite of passage, notorious for being one of the most difficult and time-consuming projects in the entire CS curriculum. Despite the challenge, I was able to complete the project on time and earn 100% for the assignment.

smallsh implements a command line interface similar to well-known shells, such as bash. The program

  • Prints an interactive input prompt
  • Parses command line input into semantic tokens
  • Implements parameter expansion
  • Interprets shell special parameters $$, $?, and $! and generic parameters as ${parameter}
  • Implements two shell built-in commands: exit and cd
  • Executes non-built-in commands using the the appropriate EXEC(3) function.
  • Implements redirection operators ‘<’,  ‘>’ and '>>'
  • Implements the ‘&’ operator to run commands in the background
  • Implements custom behavior for SIGINT and SIGTSTP signals

smallsh.c