Livl Shell  0.1
Livl Shell is an intermediate reimplementation of the bash shell in C language.
Functions
redirection.h File Reference

File containing the redirection functions to manage the redirection operators such as '<', '<<', '>', '>>' and '|'. More...

#include "typedef.h"
#include <fcntl.h>
#include <sys/stat.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <sys/wait.h>
Include dependency graph for redirection.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void handle_input_redirection (const Command *command)
 Handles input redirection with '<' operator with '<<' operator. More...
 
void handle_output_redirection (const Command *command)
 Handles output redirection with '>' operator with '>>' operator. More...
 
void evaluate_redirection (CommandSequence *sequence)
 Evaluate if a command sequence contains stream redirection operators. More...
 
void execute_pipe (Command *cmd1, Command *cmd2)
 Execute a command with pipe operator. More...
 
int is_redirection_command (const Command *command)
 Evaluate if a command is a stream redirection command. More...
 

Detailed Description

File containing the redirection functions to manage the redirection operators such as '<', '<<', '>', '>>' and '|'.

Author
Julien & Franck
Date
24 Dec 2023

Function Documentation

◆ evaluate_redirection()

void evaluate_redirection ( CommandSequence sequence)

Evaluate if a command sequence contains stream redirection operators.

Parameters
sequenceThe command sequence to evaluate

◆ execute_pipe()

void execute_pipe ( Command cmd1,
Command cmd2 
)

Execute a command with pipe operator.

Parameters
cmd1The first command
cmd2The second command

◆ handle_input_redirection()

void handle_input_redirection ( const Command command)

Handles input redirection with '<' operator with '<<' operator.

Parameters
commandCommand to be check for input redirection

◆ handle_output_redirection()

void handle_output_redirection ( const Command command)

Handles output redirection with '>' operator with '>>' operator.

Parameters
commandCommand to be check for output redirection

◆ is_redirection_command()

int is_redirection_command ( const Command command)

Evaluate if a command is a stream redirection command.

Parameters
commandThe command to evaluate
Returns
1 if the command is a stream redirection command, 0 otherwise