42sh 1.0.0
Create a shell in C
Loading...
Searching...
No Matches
cd.c File Reference

The file containing the cd builtin. More...

Functions

int cd_home (mysh_t *mysh)
 Check if the cd command is a cd ~ and execute it.
 
int cd_back (mysh_t *mysh)
 Check if the cd command is a cd - and execute it.
 
int exec_cd (mysh_t *mysh)
 The cd builtin.
 

Detailed Description

The file containing the cd builtin.

Function Documentation

◆ cd_back()

int cd_back ( mysh_t * mysh)

Check if the cd command is a cd - and execute it.

Parameters
myshThe shell structure
Returns
int 0 if the command succeed, 1 if the command failed and -1 if the command is not a cd -

◆ cd_home()

int cd_home ( mysh_t * mysh)

Check if the cd command is a cd ~ and execute it.

Parameters
myshThe shell structure
Returns
int 0 if the command succeed, 1 if the command failed and -1 if the command is not a cd ~

◆ exec_cd()

int exec_cd ( mysh_t * mysh)

The cd builtin.

Parameters
myshThe shell structure
Returns
int 0 if the command succeed, 1 otherwise