Skip to content

mo7amedgom3a/simple_shell

Repository files navigation

Simple Shell Project

A basic implementation of a shell in C, allowing users to execute commands.

Table of Contents

Description

This project is a simple shell implementation in C, where users can enter commands similar to a Unix shell. The shell supports executing internal commands like "cd" as well as external commands available on the system.

Features

  • Execution of external commands
  • Changing the current working directory using the "cd" command
  • Interactive mode and non-interactive mode
  • Basic error handling and clean code structure

Getting Started

Compilation

To compile the shell, use the following command:

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

Usage

Interactive Mode

Run the shell in interactive mode by executing the compiled binary:

./myshell

The shell will prompt with ($), and you can enter commands to execute.

Non-Interactive Mode

You can also use the shell in non-interactive mode by providing commands via input redirection:

echo "/bin/ls" | ./myshell

Example

($) /bin/ls
file1.txt file2.txt
($) cd ..
($) exit

Contributing

Contributions are welcome! If you find a bug or have a suggestion, please create an issue or a pull request.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages