Skip to content

emreyilmaz2/minishell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MINISHELL

hello there im emre and this is the readme of minishell

The project is about writing your own bash, so what is bash ?

Bash is a command processor that typically runs in a text window where the user types commands that cause actions.
Bash can also read and execute commands from a file, called a shell script. Long story short, bash is the 
terminal's language in Unix/Linux systems.

In ecole 42 schools me and my friend Can started the project minishell together. We finished in almost 2 months.(yeah, a little much)
We messed around with tons of segmentation faults, bus errors and aborts.

So this is a command line processor and we had to choose a walkthrough. You can see it below,

Ekran Resmi 2023-02-04 02 34 41

So in 'lexer' stage we need split command (our input) into pieces like below;

Ekran Resmi 2023-02-04 23 38 43

In expander, we should expand variables contained by environment variables like HOME, USER, PWD etc.
 Before that what is environment variables? The shell uses environment variables to store information,
 such as the name of the current user, the name of the host computer, and the default paths to any commands.
 Environment variables are inherited by all commands executed in the shell's context, and some commands
 depend on environment variables.

Ekran Resmi 2023-02-04 15 55 53 Ekran Resmi 2023-02-04 23 56 04

We splitted and expand our input. Now we should parse input into nodes and analyze every node,
like this is command, this is just text and this is the outfile stream of this node etc.

Ekran Resmi 2023-02-05 00 17 23 Ekran Resmi 2023-02-05 00 22 44

About

busy for learning bash programming

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published