Giter Club home page Giter Club logo

simple_shell's Introduction

0x16. C - Simple Shell

Description

This Simple Shell project is a collaboration between Gerald Juwah and Ahmed A. Olawale. Who are Software Engineers studing as students of ALX school. This project consists of developing and making our own UNIX command interpreter (Shell).

This Simple_shell project can be compiled and launched from the command line, where its main function is to execute commands read from the standard input.

Shell Compilation

$ gcc -Wall -Werror -Wextra -pedantic *.c -o hsh

Shell execute

./hsh

Commands on shell process

cd - Change directory
env - List the current enviroment variables
exit - exit the shell
pwd - Print the absolute pathname

Files

Description of the files used:

Files Description
_calloc.c Function that allocates memory
_cd.c Function that changes to the directory of the process
_ex.c Function that finds if input is esit, therefore terminates process
_fork.c Function that creates process and executes
_getline.c Function that reads what the user writes
_signal.c Function that handles the SIGINT signal
_writerr.c Function that gets each error
checkbin.c Function that checks if commands exits in the PATH
gridfree.c Function that free an array of arrays
parser.c Function that creates an array of pointers depending on the delimit characters used
sshell.c Main function that starts the shell
shell. h Header file with all the functions prototypes

Examples

Some of the examples of this shell working process:

cd:

#cisfun$ pwd
/home/vagrant/simple_shell
#cisfun$ cd
#cisfun$ pwd
/home/vagrant
#cisfun$

cd error:

#cisfun$ cd hola
./hsh: 1: cd: can't cd to hola
#cisfun$

exit:

#cisfun$ exit 123
vagrant@vagrant-ubuntu-trusty-64:~/simple_shell$ echo $?
123

exit error:

#cisfun$ exit hola
./hsh: 2: exit: Illegal number: hola
#cisfun$

Authors

simple_shell's People

Contributors

ayobamy avatar gejix avatar

Stargazers

 avatar

Watchers

 avatar

simple_shell's Issues

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.