Git Product home page Git Product logo

simple_shell's Introduction

Build Status

Simple_Shell Project

SHELL'S BELLS ! 🔥 🔥

Welcome to the Robert-Martin Simple Shell Project this shell can be compiled and run from the command line, it includes basic features, as well as some advanced features found in most shell programs.

Table of contents

Prototype

The prototype of our main function is as follows:

int main(int argc __attribute__((unused)), char **argv, char **env);

The header file is called holberton.h where all the function prototypes, structures and libraries used in our shell are referenced.

Quick Start

  • git clone this repository to your local machine.
$ git clone https://github.com/sebascastel/simple_shell
  • cd into simple_shell/ directory.
$ cd simple_shell/
  • Compile the program.
 $ gcc -Wall -Werror -Wextra -pedantic *.c -o hsh

or

$ make 
  • Execute the Shell's Bells !
$ ./hsh

Note: Shell's Bells can also be run in non-interactive mode:

$ echo "/bin/ls" | ./hsh

Syntax

This Shell, has a familiar syntax when running commands, as other common Shells:

†Shell's Bells† <command> <flags>
  • non-interactive mode:
$ echo "<command>" | ./hsh

Example Usage

interactive mode

  • ls command:
†Shell's Bells† ls -1
  • pwdcommand:
†Shell's Bells† pwd
  • cd command:
†Shell's Bells† cd ..
  • help command:
†Shell's Bells† help <builtin command>
  • # comments
†Shell's Bells† echo Hello # World
Hello

Builtins

Our Shell supports a variety of builtin commands:

exit - exits the Shell

env - prints the environment variables.

setenv - sets an environment variable.

unsetenv - unsets an environment variable.

cd - changes directory.

help - displays help for builtin commands.

Bonus

welcome - displays a welcome message 😄

bart - shows Bart Simpson 😄

Files

A short description of every file used in this project.

File Name Description
AUTHORS file containing the contributing authors
README.md readme file explainig wht this project is about
_getline.c implementation of getline function
_help.c implementation of builtin help function
_realloc.c realloc reallocates memory
_strcat.c function that concatenates three strings
_strcmp.c compares two strings
_strcpy.c copies the string pointed by src to pointer dest
_strdup.c duplicates a string
_strtok.c implemetation of builtin strtok function
add_node_end.c adds a new node at the end of a linked list
bart.c builtin function that prints bart
bart.txt text file which contains ASCII bart
cd.c implementation of cd builtin function
ch_pwd.c changes current working directory
colors.c a set of colors used to bring to life our Shell 💥
colors_2.c another set of colors
cp_env.c makes a copy of the environment variables
create_arg_list.c takes the input buffer and creates argument list
delete_node_ind.c deletes a node at a given index
error.c writes error message to standard output
exec.c forks and execute command
exit_built.c builtin exit function
free_list.c frees memory for linked lists
handler.c handles the ctrl-c key to keep looping
help_options.c a collection of helper builtin functions
holberton.h header file
man_1_simple_shell Shell's Bells man page
not_builtin.c core function of our Shell
path.c searches the correct path of command and concatenates the path with '/' and command
perm.c checks permisions
print_env.c builtin function of env prints the environment
search_env.c searches for the environment string pointed to by name
set.c sets or updates environment variable builtin setenv function
shell.c main fucntion of our †Shell's Bells† shell
split.c takes a string and splits it into key value pair
struct_builtin.c function to find builtins functions
to_str.c converts an integer into a string
unset.c removes environment variable builtin unsetenv function
welcome.c builtin function that prints welcome message
welcome.txt text file which contains ASCII welcome message

Back to Top

AUTHORS

This project was created by - Robert Castellanos and Andres Martin at Holberton School Colombia cohort 0.

simple_shell's People

Contributors

sebascastel avatar andres-martin avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Forkers

andres-martin

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.