Minishell 1.0
42 School Minishell Project - A simple shell implementation
Yüklüyor...
Arıyor...
Eşleşme Yok
builtin_export.c
Bu dosyanın dokümantasyonuna git.
1/* ************************************************************************** */
2/* */
3/* ::: :::::::: */
4/* builtin_export.c :+: :+: :+: */
5/* +:+ +:+ +:+ */
6/* By: hgenc <hgenc@student.42kocaeli.com.tr> +#+ +:+ +#+ */
7/* +#+#+#+#+#+ +#+ */
8/* Created: 2026/01/17 18:47:00 by hgenc #+# #+# */
9/* Updated: 2026/01/18 17:25:00 by hgenc ### ########.fr */
10/* */
11/* ************************************************************************** */
12
13/**
14 * @file builtin_export.c
15 * @brief export builtin komutu implementasyonu
16 */
17
19#include <stdlib.h>
20#include <unistd.h>
21
22int builtin_export(t_shell *shell, t_cmd *cmd)
23{
24 int i;
25 int ret;
26
27 if (!cmd->args[1])
28 return (print_export_list(shell), 0);
29 ret = 0;
30 i = 1;
31 while (cmd->args[i])
32 {
33 if (process_export_arg(shell, cmd->args[i]))
34 ret = 1;
35 i++;
36 }
37 return (ret);
38}
int builtin_export(t_shell *shell, t_cmd *cmd)
int process_export_arg(t_shell *shell, char *arg)
void print_export_list(t_shell *shell)
Argümansız export - tüm değişkenleri alfabetik sıralı yazdırır.
Minishell ana header dosyası
struct s_cmd t_cmd
struct s_shell t_shell
char ** args
Definition minishell.h:129