Skip to content

SchneiderSix/holbertonschool-simple_shell

Repository files navigation


Logo

Simple Shell

Recreate a Simple Shell in C
Explore the docs »

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Examples
  5. Flowchart
  6. Contact

About The Project

This is a mandatory project for Holberton School made by Juan Matias Rossi from cohort 18. This project is about recreate or build a command intepreter similar to linux shell. This recreation can only take one command per usage and can't process special characters: ", ', `, \, *, &, #.

(back to top)

Getting Started

Simple shell is a interpreter command-line between kernel and the user mode for it can use the resources of the Operative System. This recreation tokenize the input given into strings, checks the permission of the paths/files and executes the command. This requieres at least Ubuntu 14.04 LTS and gcc 4.8.4.

Clone the repository

git clone https://github.com/SchneiderSix/holbertonschool-simple_shell.git

Use these flags if you want to compile

gcc -Wall -Werror -Wextra -pedantic -std=gnu89

Compile with every .c and the header from this repo (you can add your files here if you want)

gcc -Wall -Werror -Wextra -pedantic -std=gnu89 *.c nice_header.h

Execute the built executable file

./a.out

You can read the man file just like this

man ./man_1_simple_shell

(back to top)

Usage

You can use this recreation in "Non-interactive mode" or "Interactive mode", remember "this recreation can only take one command per usage and can't process special characters: ", ', `, \, *, &, #.". You can close the program writing exit or pressing ctrl + D.

  • Interactive mode Execute the ./a.out file and write the input.

  • Non-interactive mode Use echo the command wanted and pipe it with the ./a.out file, for example echo "ls" | ./a.out.

(back to top)

Flowchart

flowchart

(back to top)

Examples

Interactive mode ls intls

Interactive mode pwd intpwd

Non-interactive mode ls nonintls

Non-interactive mode pwd nointpwd

(back to top)

Contact

Project Link: https://github.com/SchneiderSix/holbertonschool-simple_shell

(back to top)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages