Skip to content

mota494/42_minishell

Repository files navigation

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

50x -> Execution, redirection and heredoc

60x -> Builtins

70x -> Signal Handler

Issues

missing quotation giving invalid read

$export error