Skip to content

ollie-joestar/minishell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

▗▖ ▗▖▗▄▄▄▖▗▖ ▗▖▗▄▄▄▖ ▗▄▄▖▗▖ ▗▖▗▄▄▄▖▗▖ ▗▖
▐▛▚▞▜▌ █ ▐▛▚▖▐▌ █ ▐▌ ▐▌ ▐▌▐▌ ▐▌ ▐▌
▐▌ ▐▌ █ ▐▌ ▝▜▌ █ ▝▀▚▖▐▛▀▜▌▐▛▀▀▘▐▌ ▐▌
▐▌ ▐▌▗▄█▄▖▐▌ ▐▌▗▄█▄▖▗▄▄▞▘▐▌ ▐▌▐▙▄▄▖▐▙▄▄▖▐▙▄▄▖

Our minishell with Hanju-kun UwU

PLAN

  1. Read from the command line:

    • Read the input from the command line.
    • The input will be a string of words separated by spaces.
    • The program will read the input and store it in a variable.
    • Handle the signals Ctrl+C and Ctrl+Detc. getcmd() returns string
  2. Syntax check:

    • Check if the input is a valid format.
    • If the input is not a valid format, print an error message and exit the program.

    syntaxcheck() returns boolean

  3. Lexical analysis:

    • Split the input into typeless tokens.
    • Associate the tokens with their respective types.
    • Expand the variables if needed.
    • Store the tokens in a list with their respective types. lex() returns list of tokens
  4. Parsing:

  5. Execution:

    • Execute the command.
    • If the command is a builtin command, execute the builtin command.
    • If the command is not a builtin command, execute the external command. execute() returns None

//WORST CASE //minishell> < infile1 << "lim" > outfile1 echo hello world > outfile2 < infile2 | < infile3 "ca""t" > outfile3 *** BONUS PART*** && echo hello world // ";" not implemented //< infile > outfile NOT NEEDED !!!!!!!!!! //< infile cat > outfile should work //< infile cat | > outfile should NOT WORK //

test="first" another="anything here"

open double quote -> expand variable -> split by space expand variable -> split by space open single quote -> split by space

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published