3cbfd2b52c
GitOrigin-RevId: 395879c28386e1abf20c7ecacd45880759548391
22 lines
396 B
C
22 lines
396 B
C
#include <limits.h>
|
|
#include <stdio.h>
|
|
#include <unistd.h>
|
|
|
|
int main(int argc, char **argv, char **envp) {
|
|
for (char **env = envp; *env != 0; ++env) {
|
|
puts(*env);
|
|
}
|
|
|
|
char cwd[PATH_MAX];
|
|
if (getcwd(cwd, sizeof(cwd))) {
|
|
printf("CWD=%s\n", cwd);
|
|
} else {
|
|
perror("getcwd() error");
|
|
return 1;
|
|
}
|
|
|
|
for (int i=0; i < argc; ++i) {
|
|
puts(argv[i]);
|
|
}
|
|
return 0;
|
|
}
|