Skip to content

ConnorBrereton/simple_shell

 
 

Repository files navigation

🌊 🐚 SeaShell

cshell is an implementation of the original UNIX shell in C. It uses the POSIX API to implement a lot of the same functionality of Ken Thompson's first shell. The API calls predominantly used are read, write, fork, exec, and wait to name a few.

🏃 Getting Started

⚠️ Prerequisites

  • Must have git installed

  • Must have repository cloned

$ sudo apt-get install git

⬇️ Installing

Clone the repository into a new directory

$ git clone https://github.com/BennettDixon/simple_shell.git

Compile with the following:

gcc -Wall -Werror -Wextra -pedantic *.c -o seashell

📋 Examples

Using $PATH to find custom commands (executables)

> echo dog
dog
> /bin/echo dog
dog

Using && or || logic to run commands based on success

> ls -l /asdfasdf && echo this won't print!
ls: cannot access /asdfasdf: No such file or directory 
> ls -l /asdfasdf || echo this will  print!
ls: cannot access /asdfasdf: No such file or directory
this will print!

Using ; to seperate commands and run regardless of success

> ls -l /asdfasdf ; echo printme! ; wc -l main.c
ls: cannot access /asdfasdf: No such file or directory
printme!
 21 316 main.c

Using exit [status] to exit the process with status number

> exit 102
vagrant@vagrant-ubuntu-trusty-64:~/simple_shell$ echo $?
102

Using env to print the environmental variables

> env
XDG_SESSION_ID=30
TERM=ansi
SHELL=/home/vagrant/simple_shell/seashell
...
...

📚 Coding Style Tests

Strictly followed Betty style guide. To install

$ git clone https://github.com/holbertonschool/Betty.git

$ cd Betty; ./install.sh

📝 Version

  • 0.1.0

📘 Authors

🔍 License

This project is licensed under the MIT License - see the LICENSE.md file for details

📣 Acknowledgments

  • Bennett Dixon (for being a wizard)
  • Holberton School (providing guidance)
  • Stack Overflow (help on various memory errors (not leaks))

About

Connor Brereton and I are building our own shell in the C programming language

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 100.0%