Skip to content
/ mash Public

Mash, a simple shell using the POSIX system call API

Notifications You must be signed in to change notification settings

tlmader/mash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mash

Principles of Operating Systems I Programming Assignment 1

A simple shell using the POSIX system call API.

Getting Started

To run the project, use the following commands in the terminal:

  1. make
  2. ./mash.exe

Prompt

Once started, the user will be given a prompt that shows the current working directory (e.g.: /home/csci4401>), and the shell enters an infinite loop where it takes user commands and executes them.

Built-in Commands

Mash implements the cd and pwd commands that allow a user to change the current directory and to print the current directory, respectively. The exit command allows orderly shell exit.

Simple Program Execution

Unless the user types in a built-in command, any other input will be interpreted as an effort to run an executable. In response, Mash will fork() a process, execute the command and show the output (e.g.: ls -l).

Stream Redirection

Mash allows redirection of standard input/output streams to/from a file. E.g:

  • ls -l > output
  • sort alice.txt > sorted.txt o sort < alice.txt > sorted.txt

Pipes

Mash allows IPC via pipes. E.g.: ls -l | grep sh | wc -l

About

Mash, a simple shell using the POSIX system call API

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published