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

Functions

int pwd (int nargs, char **args)
 Print the full filename of the current working directory.
 

Variables

int opterr
 
int optind
 
int optopt
 
char * optarg
 

Detailed Description

Author
Swastik Pal
Version
0.1
Date
2022-11-07

Function Documentation

◆ pwd()

int pwd ( int nargs,
char ** args )

Print the full filename of the current working directory.

If no option is specified, -P is assumed. Option -L overrides -P when both are used together.

Options:

  • -L - use PWD from environment
  • -P - resolves symlinks to get the current working directory.

Variable Documentation

◆ optarg

char* optarg
extern

◆ opterr

int opterr
extern

◆ optind

int optind

◆ optopt

int optopt