Skip to content

YuranyUlchur/holbertonschool-simple_shell

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Shell Project

Description

This project is a basic recreation of the Unix Shell command interpreter that receives commands and communicates with multiple programs inside this repository to perform specific actions.

Man Page

The man page is a file wich explains how our Shell works and the commands that can be executed. To see the detailed explanation, you can run our man page this way:

$ man ./man_1_simple_shell

Flow chart 📊

flowchart

Compilation 💻

To compile this Shell, the next command has to be executed:

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

After execution, the command to run our Shell and be able to enter action commands is:

$ ./hsh

Usage

This shell can be executed two different ways, the first one is in the interactive mode, this means that after the shell is compiled, the user can call the commands directly in the executable file. Working as the following:

$ ./hsh
($) 

Executing the shell will show the prompt $ shown previously and is going to wait until the user enters a command, so an example will be:

$ ./hsh
($) ls
File1.c File2.c Header.h

The second option is execute it in non-interactive mode, this means that after the compilation, the shell is going to be executed by entering commands using a pipe line. An example of this execution will be:

$ echo "/bin/ls" | ./hsh
hsh main.c shell.c test_ls_2

Files list

The following list will tell us what files are necessary to run the shell successfully:

File Description
auxiliar_functions.c Has functions that will divide the string (input) and check if it's valid.
main.c Main function that will execute the shell.
str_functions.c Has recreated functions to modify and manipulate strings, such as strcpy, strlen, etc.
shell.h Has header declarations, such as libraries, global variables and prototypes.

Command list

The next list is a summarized chart of some the allowed commands that can be executed in our shell.

Command Description
ls Displays the names of files and directories contained within the current directory.
pwd Prints the full path of the current working directory.
echo Writes its arguments separated by blanks and terminated by a new line on the standard output.
env Execute command and print environment.
exit The exit command causes normal process termination of the Shell.

Authors 🖊

  • Juan Esteban Duque github
  • Yurany Ulchur github

This project was made for Holberton School's software development program.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 100.0%