Coder Social home page Coder Social logo

simple_shell's Introduction

0x16. C - Simple Shell

πŸ“„ πŸš€

Description

This project is an implementation of the shell created as a Milestone Project for the C code at ALX Africa Software Engineering.
The gates of shell is a project in the first trimester, that helps student to understand the advanced concepts behind the shell program include process, system call, bit manipulation, file managment, error handling ...
Shell is a simple UNIX command interpreter that replicates functionalities of the simple shell (sh).
This program was written entirely in C Language.

COPYRIGHT

Copyright (C) 2022 by Reny Kipkoech and Stellah Mbao
All rights reserved

Description :

This is a shell written in C. It is based on the Thompson Shell.

Environment :

Our shell was built and tested on Ubuntu 14.04 LTS.

Features

  • Display a prompt and wait for the user to type a command. A command line always ends with a new line.
  • If an executable cannot be found, print an error message and display the prompt again.
  • Handle errors.
  • Hndling the β€œend of file” condition (Ctrl+D)
  • Hanling the command line with arguments
  • Handle the PATH
  • Support the exit features and the exit status
  • Handle the Ctrl-C to not terminate the shell
  • Handling the command seperator ;
  • Handling && and || logical operators
  • Handle variable replacements $? and $$
  • Handle the comments #
  • Support the history feature
  • Support the file input

Builtins

Our shell has support for the following built-in commands:

Command Definition
exit [n] Exit the shell, with an optional exit status, n.
env Print the environment.
setenv [var][value] Set an environment variable and value. If the variable exists, the value will be updated.
alias[name[='value]] Reads aliases name
unsetenv [var] Remove an environment variable.
cd [dir] Change the directory.
help [built-in] Read documentation for a built-in.

Installation : Getting HSH

Clone the below repository and compile the files into an executable using the GCC compiler.

https://github.com/StellahMbao/simple_shell.git

Basic usage πŸ’‘

  • First, Fork this Repository Learn how to fork repo.
  • Then Clone Learn how to clone .
  • Create an executable by running the following command:
  • gcc -Wall -Werror -Wextra -pedantic *.c -o hsh
  • From there, type in the following command and press your enter button.
  • ./hsh
  • Final step: ENJOY!

Example πŸ’»

ls -la

114757753-e50c2180-9d64-11eb-95ea-fb9bba776c8c

Contributors :

Acknowledgments :

  • The creators of the C language.
  • Our software engineer-in-residence.
  • Betty Holberton | Alx-Africa .

simple_shell's People

Contributors

tr-reny avatar stellahmbao avatar

Watchers

Tafadzwa Wilson Sedze avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.