Livl Shell
0.1
Livl Shell is an intermediate reimplementation of the bash shell in C language.
|
File containing the built-in commands functions to manage the built-in commands such as cd, pwd, echo, exit. More...
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include "typedef.h"
#include "constants.h"
#include "command_sequence.h"
#include "alias.h"
Go to the source code of this file.
Functions | |
int | execute_builtin_command (const Command *command, CommandSequence *sequence) |
Executes a command. More... | |
void | pwd () |
Prints the current working directory. | |
void | cd (const char *path) |
Changes the current directory. More... | |
int | is_builtin_command (const Command *command, const char *expected) |
Checks if the command is a built-in command. More... | |
int | exit_shell (CommandSequence *sequence, int exit_code) |
Exits the shell. More... | |
void | echo (const Command *command) |
Prints a message. More... | |
File containing the built-in commands functions to manage the built-in commands such as cd, pwd, echo, exit.
void cd | ( | const char * | path | ) |
Changes the current directory.
path | The path to the new directory |
void echo | ( | const Command * | command | ) |
Prints a message.
command | The command to execute to be able to print all the arguments |
int execute_builtin_command | ( | const Command * | command, |
CommandSequence * | sequence | ||
) |
Executes a command.
command | The command to execute |
sequence | The command sequence to free |
int exit_shell | ( | CommandSequence * | sequence, |
int | exit_code | ||
) |
Exits the shell.
sequence | The command sequence to free |
exit_code | The exit code status |
int is_builtin_command | ( | const Command * | command, |
const char * | expected | ||
) |
Checks if the command is a built-in command.
command | The command to check |
expected | The expected command name |