jicruz96 / jish

A `sh` shell terminal replica, written from scratch, in C

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jish - A sh replica


Overview

jish is a UNIX command interpreter. It is a replica of the sh shell, built from scratch in C.

This project was developed as part of the Holberton School Low Level Systems specialization and is the second, more advanced version of the simple shell project completed in the Foundations year.

This project was written by J.I. Cruz, with assistance from Gabriel Abdul-Raheem.

Installation 🛠

Requirements

  • jish is only available for MacOS and Linux distributions.
  • make

Clone this repository to your local system. Use the following to compile the program and save the executable into a file named jish:

make

Usage

Interactive shell

$ ./jish
  • Run the executable file. Use the shell as if it were your normal shell. All commands-- including pipes, redirects, and aliases-- should work. That's it!
  • Type exit or Ctrl-D to exit jish.

Non-interactive mode

You can also use jish non-interactively. Use echo to pipe in a command to jish. The program will execute the inputted command(s) without re-prompting.

$ echo "ls" | ./jish

✨ Features ✨

jish can run any executables in the PATH. The following built-in commands are also available:

Built-in Use
exit [status] Exit shell with specified exit status
env Print list of current environment variables
setenv Set an environment variable
unsetenv Unset an environment variable
cd Change directories
history Print command history
help Display help for builtin commands
alias [ALIAS='COMMAND'] Alias a command as another. If no alias is given, print all aliases

Release History 🧾

This is version 2.0 of a previous Holberton School project.

Gabriel's Previous Shell

J.I.'s Previous Shell

Authors 👨🏽‍💻

About

A `sh` shell terminal replica, written from scratch, in C


Languages

Language:C 98.6%Language:Makefile 1.4%