1 /* vi: set sw=4 ts=4: */
3 * printenv implementation for busybox
5 * Copyright (C) 2005 by Erik Andersen <andersen@codepoet.org>
6 * Copyright (C) 2005 by Mike Frysinger <vapier@gentoo.org>
8 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
13 /* This is a NOFORK applet. Be very careful! */
15 int printenv_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
16 int printenv_main(int argc UNUSED_PARAM, char **argv)
18 int exit_code = EXIT_SUCCESS;
20 /* no variables specified, show whole env */
26 /* search for specified variables and print them out if found */
29 while ((arg = *++argv) != NULL) {
34 exit_code = EXIT_FAILURE;
38 fflush_stdout_and_exit(exit_code);