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 export: Export an environment variable
29 #include <environment.h>
31 static int do_export(struct command
*cmdtp
, int argc
, char *argv
[])
37 return COMMAND_ERROR_USAGE
;
40 if ((ptr
= strchr(argv
[i
], '='))) {
44 if (export(argv
[i
])) {
45 printf("could not export: %s\n", argv
[i
]);
54 static const __maybe_unused
char cmd_export_help
[] =
55 "Usage: export <var>[=value]...\n"
56 "export an environment variable to subsequently executed scripts\n";
58 BAREBOX_CMD_START(export
)
60 .usage
= "export environment variables",
61 BAREBOX_CMD_HELP(cmd_export_help
)
65 * @page export_command export: Export an environment variable
67 * Usage: export \<var>[=value]...
69 * Export an environment variable to subsequently executed scripts.