hush/pwd.c

19 lines
304 B
C
Raw Normal View History

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