Add export builtin

This commit is contained in:
g1n 2021-09-28 14:04:55 +03:00
parent d35e7e4b38
commit c4f6fc8edd
1 changed files with 6 additions and 0 deletions

View File

@ -125,6 +125,12 @@ int parse_command(char **command, int status) {
}
} else if (!strcmp(command[0], "pwd")) {
printf("%s\n", pwd);
} else if (!strcmp(command[0], "export")) {
for (int i = 1; i <= position - 1; i++) {
status = putenv(command[i]);
if (status != 0)
return status;
}
} else if (!strcmp(command[0], "!")) {
if (status != 0)
status = 0;