Skip to content

peterdjlee/Systems_Shell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Systems_Shell

Kevin Li and Peter Lee
Period 10

Features

  • Forks and executes commands
  • Has a nice greeting when you open the shell!
  • Handles cd and exit
  • Displays working directory, like bash
  • Can execute multiple commands on one line separated with semicolon (";")
  • Says something sad but cute when you quit shell!
  • When you do something bad in the shell, it will print out bash-like errors using errno
  • 'magic' can hide or show your working directory
  • Implements redirect stdout

Attempted

  • Handle multiple commands on one line when semicolons or commands are surrounded with spaces, like " ; " instead of just ";"
  • Redirection and pipes

Bugs

  • Very occasionally the parser fails and cannot read the commands correctly. We tested it, and every time it happens, it can't read a certain character and reads it as a space.
  • Commands cannot be executed if there are any spaces regardless of usage of semicolons
  • The redirection breaks if multiple ">"s are entered.

Files and Function Headers

main.c

shell.c

char ** parse_args(char * line, char delimiter)
  • Description:
    • Parses the given string using the given delimiter
  • Arguments:
    • char * line -> A pointer to the original string
    • char delimiter -> The character that is going to be used to parse the string
  • Return Value:
    • A char ** which consists of the parsed strings
void exec_one(char ** args)
  • Description:
    • Forks off a child process and the child process calls execvp to execute the given command
  • Arguments:
    • char ** args -> Command line arguments that should be executed
  • Return Value:
    • N/A
void redir_out(char ** args)
  • Description:
    • Implements redirecting stdout by writing to a file
  • Arguments:
    • char ** args -> A pointer to the original string
  • Return Value:
    • N/A

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •