summaryrefslogtreecommitdiff
path: root/pwd.c
blob: 893ed1e15cd6f338f4d012ab36a83997dc4b4a18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "internal.h"
#include <stdio.h>

const char	pwd_usage[] = "Print the current directory.\n";

extern int
pwd_main(int argc, char * * argv)
{
	char		buf[1024];

	if ( getcwd(buf, sizeof(buf)) == NULL ) {
		perror("get working directory");
		exit( FALSE);
	}

	printf("%s\n", buf);
	exit( TRUE);
}