Question: When I try to run ./shell cd includes/ 
I don't actually change into the includes directory. Here's my code:

```
int cd(char *path) {
        printf("i got there at least\n");
        if(path  == NULL) {
                printf("dont waork\n");
                print_usage();
        } else {

                printf("print please\n");
                int dir_change = chdir(path);
                if(dir_change != 0)
                        print_no_directory(path);

        }
        return 1;
}

int shell(int argc, char *argv[]) {

        pid_t pid;
        int status;

        pid = fork();
        if(pid == 0) {
                execl("cd", argv[0], argv[1], argv[2], (char*)NULL);
                printf("argv[1]: %s\n", argv[1]);
                if(!strcmp(argv[1], "cd")) {
                        cd(argv[2]);
                }
        } else if(pid > 0) {
                waitpid(pid, &status, WUNTRACED);
        } else {
                print_fork_failed();
        }
        return 0;
}

```

I don't see what's wrong with my code.

Answer: 
You can't run a program to change the directory of another program (your shell).

What happens is

1. A new process is spawned to run your program
2. That program calls `chdir()`, to change its current directory
3. The program end, causing the process to die
4. The shell is still where it was

That's why `cd` in the shell is a built-in command.
you cannot create a `cd` command like this unless you develop your own shell.

The `chdir` command works, but only inside your program. Once you exit it, you're back to the parent shell current directory.