2 * Copyright (c) 2007 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
4 * See file CREDITS for list of people who contributed to this
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2
9 * as published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 * @brief setenv: Set an environment variables
29 #include <environment.h>
31 static int do_setenv(struct command
*cmdtp
, int argc
, char *argv
[])
34 return COMMAND_ERROR_USAGE
;
36 setenv(argv
[1], argv
[2]);
41 static const __maybe_unused
char cmd_setenv_help
[] =
43 " - set environment variable 'name' to 'value ...'\n"
45 " - delete environment variable 'name'\n";
48 BAREBOX_CMD_START(setenv
)
50 .usage
= "set environment variables",
51 BAREBOX_CMD_HELP(cmd_setenv_help
)
55 * @page setenv_command setenv: set an environment variable
57 * Usage: setenv \<name> [\<value>]
59 * Set environment variable \<name> to \<value>. Without a given value, the
60 * environment variable will be deleted.
62 * @note This command is only available if the simple command line parser is
63 * in use. Within the hush shell \c setenv is not required.