Giter Club home page Giter Club logo

simple_shell's Introduction

Simple shell Holberton School

This project contains the implementation of a UNIX simple line command interpreter.

File Descriptions

  • shell.c -> contains the main program for the simple_shell.
  • getenv.c-> contains the function that brings the enviromen variable PATH.
  • functions_prints.c -> contains the functions allowed to print to the standar output.
  • check_builtin.c -> contains the function that checks if a command is a builtin function or not.
  • built_in.c -> contains the function to be execute when command is a builtin function.
  • aux_func.c -> contains the auxiliar functions to deal with string manipulation.
  • holberton.h -> contains the definition of functions, structures and shared libraries.
  • man_1_simple_shell -> manual page archive

Usage

Simple_shell is an sh-compatible command language interpreter that executes commands read from the standard input.

Example

#include "holberton.h"  
/*Invocation*/
bash $ ./simple_shell
$      /*Our shell is running and waiting to receive commands*/
/* command execution interactive */
$ ls -l /usr
total 76
drwxr-xr-x   2 root root 36864 Aug 13 18:02 bin
drwxr-xr-x   2 root root  4096 Apr 10  2014 games
drwxr-xr-x  35 root root  4096 Jul 18 01:02 include
drwxr-xr-x  78 root root  4096 Aug 13 18:02 lib
drwxr-xr-x   3 root root  4096 Jun 11 03:45 lib32
drwxr-xr-x   3 root root  4096 Jun 11 03:45 libx32
drwxr-xr-x  10 root root  4096 Nov  7  2019 local
drwxr-xr-x   2 root root  4096 Jun  2 04:21 sbin
drwxr-xr-x 140 root root  4096 Aug 13 18:02 share
drwxr-xr-x   5 root root  4096 Nov  7  2019 src

$pwd
/home/vagrant/simple_shell

/* command execution directly from bash using pipes*/
bash $ echo "ls -l /usr" | ./simple_shell
total 76
drwxr-xr-x   2 root root 36864 Aug 13 18:02 bin
drwxr-xr-x   2 root root  4096 Apr 10  2014 games
drwxr-xr-x  35 root root  4096 Jul 18 01:02 include
drwxr-xr-x  78 root root  4096 Aug 13 18:02 lib
drwxr-xr-x   3 root root  4096 Jun 11 03:45 lib32
drwxr-xr-x   3 root root  4096 Jun 11 03:45 libx32
drwxr-xr-x  10 root root  4096 Nov  7  2019 local
drwxr-xr-x   2 root root  4096 Jun  2 04:21 sbin
drwxr-xr-x 140 root root  4096 Aug 13 18:02 share
drwxr-xr-x   5 root root  4096 Nov  7  2019 src
bash $

Flowchart

This is the flowchart of our program.

Flowchart

Authors

simple_shell's People

Contributors

ana-morales avatar oomsebas avatar

Watchers

 avatar

Forkers

oomsebas

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.