• Shell is a command-line interpreter providing a user interface to access the operating system's services. This project involves the development of a sh-type shell program (Bourne Shell), typically used through a terminal emulator.
• The shell interprets commands. It incorporates features such as process control, input/output redirection, and is used to write batch programs or scripts. Unix-like systems all have at least one Bourne shell-compatible interpreter.
• Several tasks are listed, from creating README and manual to implementing various versions of the shell.
• OS: Ubuntu 20.04 LTS
• Language: C
• Compiler: gcc 9.3.0
• Editor: VIM 8.1.2269
• Version control: Git
• Style: Betty style
• Use of vi, vim, emacs editors
• Compilation on Ubuntu 14.04 LTS with gcc 4.8.4
• Compliance with Betty style, without memory leaks
• Output identical to sh (/bin/sh)
• List of authorized functions such as execve, exit, fork, malloc, write, etc.
• gcc -Wall -Werror -Wextra -pedantic -std=gnu89 *.c -o hsh
• Instructions for cloning the repository, changing directories, compiling, and running the shell in interactive or non-interactive mode.
• Example of execution and output after compilation.
$ ./hsh
($) /bin/ls
hsh main.c shell.c
($)
($) exit
$
$ echo "/bin/ls" | ./hsh
hsh main.c shell.c test_ls_2
$
$ cat test_ls_2
/bin/ls
/bin/ls
$
$ cat test_ls_2 | ./hsh
hsh main.c shell.c test_ls_2
hsh main.c shell.c test_ls_2
$
• Description and links to different project files, such as the manual, scripts, and source code files.
• Image illustrating the flowchart of the project.
Shell Start: Initializing the environment.
Displaying the Command Prompt: In interactive mode, the shell displays a prompt.
Reading the Command: The shell reads the command line entered by the user.
Analyzing the Command: Identification of the command and arguments.
Executing the Command: Either a built-in command or an external command.
Managing Results: The shell handles results or errors.
Return to Command Prompt or Shell Termination: In interactive mode, return to the command prompt, otherwise termination of the shell.