busybox/pwd.c

19 lines
304 B
C
Raw Normal View History

1999-10-05 21:54:54 +05:30
#include "internal.h"
#include <stdio.h>
const char pwd_usage[] = "Print the current directory.\n";
extern int
1999-10-12 21:12:48 +05:30
pwd_main(int argc, char * * argv)
1999-10-05 21:54:54 +05:30
{
char buf[1024];
if ( getcwd(buf, sizeof(buf)) == NULL ) {
1999-10-12 21:12:48 +05:30
perror("get working directory");
exit( FALSE);
1999-10-05 21:54:54 +05:30
}
printf("%s\n", buf);
1999-10-12 21:12:48 +05:30
exit( TRUE);
1999-10-05 21:54:54 +05:30
}