Changeset View
Changeset View
Standalone View
Standalone View
usr.bin/env/env.c
| Show First 20 Lines • Show All 208 Lines • ▼ Show 20 Lines | main(int argc, char **argv) | ||||
| } else { | } else { | ||||
| if (altwd) | if (altwd) | ||||
| errx(EXIT_CANCELED, "must specify command with -C"); | errx(EXIT_CANCELED, "must specify command with -C"); | ||||
| if (altpath) | if (altpath) | ||||
| errx(EXIT_CANCELED, "must specify command with -P"); | errx(EXIT_CANCELED, "must specify command with -P"); | ||||
| } | } | ||||
| for (ep = environ; *ep; ep++) | for (ep = environ; *ep; ep++) | ||||
| (void)printf("%s%c", *ep, term); | (void)printf("%s%c", *ep, term); | ||||
| if (fflush(stdout) != 0) | |||||
| err(1, "stdout"); | |||||
| exit(0); | exit(0); | ||||
| } | } | ||||
| static void | static void | ||||
| usage(void) | usage(void) | ||||
| { | { | ||||
| (void)fprintf(stderr, | (void)fprintf(stderr, | ||||
| "usage: env [-0iv] [-C workdir] [-L|-U user[/class]] [-P utilpath] [-S string]\n" | "usage: env [-0iv] [-C workdir] [-L|-U user[/class]] [-P utilpath] [-S string]\n" | ||||
| " [-u name] [name=value ...] [utility [argument ...]]\n"); | " [-u name] [name=value ...] [utility [argument ...]]\n"); | ||||
| exit(1); | exit(1); | ||||
| } | } | ||||