From cc8ed39b240180b58810784f844e253263594ac3 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Tue, 5 Oct 1999 16:24:54 +0000 Subject: Initial revision --- coreutils/pwd.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 coreutils/pwd.c (limited to 'coreutils/pwd.c') diff --git a/coreutils/pwd.c b/coreutils/pwd.c new file mode 100644 index 000000000..d9ab54e48 --- /dev/null +++ b/coreutils/pwd.c @@ -0,0 +1,18 @@ +#include "internal.h" +#include + +const char pwd_usage[] = "Print the current directory.\n"; + +extern int +pwd_main(struct FileInfo * i, int argc, char * * argv) +{ + char buf[1024]; + + if ( getcwd(buf, sizeof(buf)) == NULL ) { + name_and_error("get working directory"); + return 1; + } + + printf("%s\n", buf); + return 0; +} -- cgit v1.2.3