Skip to content

mota494/42_minishell

Repository files navigation

Minishell

Static Badge Static Badge

Functions HOORAY

#include <unistd.h>
#include <stdlib.h>
#include <linux/limits.h>

char *getcwd(char *buffer, size_t size); //returns the current directory, MAX_PATH can be used as size

int chdir(const char *prt); //changes the current working directory considering the path (*prt) given, return 0 on sucess and -1 if an errors occurs

int access(const char *path, int amode); 
/*checks if a file or directory can be accessed according to the mode given
: F_OK, tests for file existence; R_OK tests for read permission; W_OK tests for writing permission and X_OK test for execution permission*/

char *getenv(const char *name); //searches for the variable with *name and returns it's value string

Usefull links

Blackberry's QNX developers documentation

Jarret B Bash documentation

GNU Bash Manual

User and built-in variables

File naming system

0xx -> Utils that are used by multiple files

10x -> Files that deal with starting minishell and ending minishell

20x -> Files that deal with syntax checking and everything in between

30x -> Files that deal with tokenization

40x -> Files that deal with parsing quotes and variables

41x -> Heredoc files

50x -> Execution, redirection and heredoc

60x -> Builtins

70x -> Signal Handler

Notes

This project was made by me and Sofia Bueno

If you're from 42, feel free to test it out but if you find any errors or memory leaks I don't care the project was already handed and i don't plan on updating it to solve every issue that i know it exists I'd have to redo the project from the start