Skip to content

This project is a CLI that replicates the shell behavior executing binary files inside a bash.

Notifications You must be signed in to change notification settings

EsneiderGrVc/simple_shell

Repository files navigation

simple_shell

simple_shell is a project that aims to emulate the UNIX shell behavior.

Description:

simple_shell project is a program developed in C lenguage using the following concepts:

  • PID & PPID
  • Arguments
  • Executing a program
  • Creating processes
  • Wait
  • File information
  • Environment

The key functions and system calls used to develope this program are: exceve - exit- fork - free - getline isatty - malloc- perror - read - stat strtok - wait- write

Compilation and Execution

1. Clone the repository

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

2. Compile

To compile the shell you need the gcc 4.8.4 version or upper. Then, compile in this way:

gcc -Wall -Werror -Wextra -pedantic *.c holberton.h -o hsh

3. Execute interactive mode.

Executing the shell in interactive mode follows to interact with the program passing one of the commands allowed one by one until you decide ending the executing process typing exit or pressing the command Ctrl + D.

./hsh

4. Execute no interactive mode.

Executing the shell in no interactive mode allows pass commands throught pipeline. For instance:

echo "ls -S" | ./hsh

Additionally you can pass several commands stored in a file, like this:

cat <file> | ./hsh

Features

  • The simple_shell can perform all the programs stored in the PATH variable.
  • Also simple_shell can perform two of the built-in functions: exit and env.

Authors:

About

This project is a CLI that replicates the shell behavior executing binary files inside a bash.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages