Skip to content

Files

Latest commit

c15eafc · Sep 27, 2018

History

History
74 lines (57 loc) · 2.01 KB

README.md

File metadata and controls

74 lines (57 loc) · 2.01 KB

Shell in C

This is an implementation of a basic interactive shell done in C as an assignment for our Operating Systems course.

Running the code

  1. Download the repository as a zip, or clone it. cd into directory
  2. Run make install. Ignore any warnings shown.
  3. Run ./shell

In order to exit the shell, type exit

Files present, and file structure

Requirements as specified

Minimum requirements to be met:

  1. Display requirement username@systemname:path/to/whereever $

  2. Builtins. echo, cd, pwd. Don't use execvp.

  3. Make an ls functionality. Options to enable: -l, -a, -al/la

  4. Option to execute system command, like the ones in /bin/. Implement foreground, background processes. Should have arguments.

  5. pinfo. Prints information related to the running shell program process.

    pinfo pid should print the process related information about the process with pid.

  6. Print correct information about the background process exiting safely.

  7. Implement a 'remind me' functionality (optional)

  8. Add a clock (optional)

R2: Minimum Requirements to be met:

  1. Implement foreground and background processes properly
  2. Input/Output redirection
  3. Command redirection with pipes
  4. I/O + pipe redirection
  5. Implement setenv, getenv, jobs, kjob, fg, bg, overkill, quit, ^Z, ^C

Requirements covered so far:

  • Display
  • cd, pwd, exit
  • echo
  • ls
  • Execute processes
  • Background process (no job)
  • pinfo
  • Process exit notification
  • Reminder
  • Clock
  • Proper FG/BG
  • I/O Redirection
  • Command Redirection, pipes
  • I/O+pipes
  • setenv, getenv
  • jobs, kjo, overkill
  • fg, bg, ^Z
  • quit, ^C

Stuff to note:

  1. Usage of system is strictly prohibited.
  2. Get error handling right
  3. rollnum_assgn2.tar.gz

Basic Outline

An overview of how I think it'll function.

  • An REPL
  • Display prompt
  • Line input
  • Command processing
  • Command execution
  • along with error handling