C-Shell
A simple shell written in C.
Loading...
Searching...
No Matches
cd.c File Reference
#include <ctype.h>
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "../internal_commands.h"

Functions

int cd (int nargs, char **args)
 Change the shell working directory.
 

Variables

int opterr
 
int optind
 
int optopt
 
char * optarg
 

Detailed Description

Author
Swastik Pal
Version
0.1
Date
2022-11-09

Function Documentation

◆ cd()

int cd ( int nargs,
char ** args )

Change the shell working directory.

If no path is provided, changes the current directory to /.

Variable Documentation

◆ optarg

char* optarg
extern

◆ opterr

int opterr
extern

◆ optind

int optind

◆ optopt

int optopt