Skip to content

Vidal-m/microshell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

#42Exam-rank-04

microshell

Small shell (terminal) that executes simple commands with support for pipes (|) and separators (;). Project developed in 42 Luanda to understand the fundamentals of processes, fork, execve, pipe and chdir.


🧠 Objective

Implement a microshell capable of:

  • Execute commands with multiple arguments
  • Support chained commands with ;
  • Support | pipes
  • Handle the built-in cd command
  • Manage basic runtime errors and directories

⚙️ Compilation

cc -Wall -Wextra -Werror microshell.c -o microshell

🧪 Usage Executing simple commands bash Copy Edit ./microshell ls -l ; echo Hello Execution with pipes bash Copy Edit ./microshell ls -l | grep microshell 📝 cd command behavior bash Copy Edit ./microshell cd nonexistent_folder Exit:

vbnet Copy Edit error: cd: cannot change directory to folder_inexistente ❌ Error handling cd with invalid arguments

commands that do not exist or fail to execute

fork or pipe failures are ignored in a simplified way (according to the project scope)

🔧 Implemented functions exec_it – Execute commands with execve

cd – Own implementation of the cd command

ft_strlen – Helper function to count the length of strings

main – Handles parsing, fork, pipe, and execution control

About

the lastest version of my microshell

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages