Skip to content

GabrielBarros36/shell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Shell

A program written in C that emulates the basic functionalities of a UNIX shell.

Group Members

  • Edgar Guerrero
  • Gabriel Romanini de Barros
  • Lucas Smith

Division of Labor

Part 1: Prompt

  • Responsibilities: Make function that displays terminal prompt including user, machine, and home environment variables.
  • Assigned to: Edgar Guerrero, Lucas Smith

Part 2: Environment Variables

  • Responsibilities: Making sure any arguments representing environment variables are replaced by their actual values.
  • Assigned to: Edgar Guerrero, Lucas Smith

Part 3: Tilde Expansion

  • Responsibilities: Expanding any tildes in command arguments into the home environment variable.
  • Assigned to: Gabriel Romanini de Barros, Edgar Guerrero

Part 4: $PATH Search

  • Responsibilities: Given a command entered by the user in the CLI, search through the path environment variable to find whether the command exists and, if so, facilitate the process of executing it through system calls on parts 5 and 9.
  • Assigned to: Gabriel Romanini de Barros, Lucas Smith

Part 5: External Command Execution

  • Responsibilities: Create a child process and, in that child process only, use a system call to execute the command entered by the user.
  • Assigned to: Gabriel Romanini de Barros, Lucas Smith

Part 6: I/O Redirection

  • Responsibilities: Implement input and output redirection.
  • Assigned to: Edgar Guerrero

Part 7: Piping

  • Responsibilities: Support up to 2 pipes, supporting the simultaneous execution of up to 3 commands.
  • Assigned to: Lucas Smith

Part 8: Background Processing

  • Responsibilities: Allow commands to run in the background if users desire, periodically updating users on the status of the program and notifying them when it is done running.
  • Assigned to: Gabriel Romanini de Barros

Part 9: Internal Command Execution

  • Responsibilities: Allow for execution of internal commands. Unlike external commands they must be executed by the parent process. The internal commands supported are cd, jobs, and exit.
  • Assigned to: Edgar Guerrero, Gabriel Romanini de Barros

Extra Credit

  • Responsibilities: Achieved shell-ception functionality. A running instance of our program can exist inside another running instance, and the only limitation of how many instances one can "nest" is system resources.
  • Assigned to: Edgar Guerrero, Gabriel Romanini de Barros

File Listing

shell/
│
├── src/
│ ├── proj1.c
│ └── lexer.c
│
├── include/
│ └── lexer.h
│
├── README.md
└── Makefile

How to Compile & Execute

Requirements

  • Compiler: gcc 13.2.1

Compilation

For C:

make

Run this in the "shell" folder. This will build the executable in the 'bin' folder. You may run it from that folder or follow the directions on the 'Execution' section below.

Execution

make run

Run this in the "shell" folder. This will compile AND run the shell.

Extra Credit

  • Extra Credit 1: We have "shell-ception" functionality, so the user can nest an indefinite number of running instances of the shell inside of each other.

Considerations

  • The bin and obj folders are not in our repository since git won't keep track of empty folders. However, when the user executes the "make" or "make run" commands the folders will be created automatically and its appropriate contents will be placed inside of them.

About

A basic Unix shell written in C.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors