Skip to content

A simple shell implementation in C. Provides fundamental shell functionalities and built-in commands.

Notifications You must be signed in to change notification settings

pablovilchez/42-minishell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

42 - Minishell

42 School Git C Bash Grade

Description

Minishell is a project from 42 School that involves creating a simple yet functional shell in C. The goal of this project is to gain a deeper understanding of how shells work and to develop advanced programming skills in C.

Features

  • Execution of basic commands (e.g., ls, echo, cat, etc.)
  • Input and output redirection (>, >>, <)
  • Pipes (|)
  • Environment variables
  • Signal handling and process management
  • Support for built-in commands like cd, export, unset, env, exit

Requirements

  • Unix-based operating system (Linux or macOS)
  • GCC compiler
  • Readline library (optional for advanced functionality)

Installation

  1. Clone the repository:

    git clone https://github.com/pablovilchez/42-minishell.git
  2. Navigate to the project directory:

    cd minishell
  3. Compile the project:

    make

Usage

Run the shell by executing the following command:

./minishell

Built-in Commands

  • cd [directory]: Change the current directory.
  • export [variable]=[value]: Set an environment variable.
  • unset [variable]: Remove an environment variable.
  • env: Display the current environment variables.
  • exit [status]: Exit the shell with a status code.

Examples

$ ./minishell
minishell> ls -l
total 8
-rwxr-xr-x 1 user group 4096 Jun 12 12:00 minishell
minishell> echo "Hello, World!"
Hello, World!
minishell> cat < file.txt | grep "search" > output.txt
minishell> exit
$

Co-author

License

This project is licensed under the MIT License.

Acknowledgments

  • Thanks to 42 School for the project guidelines and support.
  • Special thanks to my teammate Gabriela for his incredible effort, hard work, and for putting up with me throughout the project.

About

A simple shell implementation in C. Provides fundamental shell functionalities and built-in commands.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published