RTEMS Logo

RTEMS 4.10.2 On-Line Library


General Commands setenv - set environment variable

PREV UP NEXT Bookshelf RTEMS Shell User's Guide

2.2.9: setenv - set environment variable

SYNOPSYS:

setenv variable [value]

DESCRIPTION:

This command is used to add a new variable to the set of environment variables or to modify the variable of an already existing variable. If the value is not provided, the variable will be set to the empty string.

EXIT STATUS:

This command will return 1 and print a diagnostic message if a failure occurs.

NOTES:

The entire RTEMS application shares a single set of environment variables.

EXAMPLES:

The following is an example of how to use setenv:

SHLL [/] $ setenv BASEPATH /mnt/hda1

CONFIGURATION:

This command is included in the default shell command set. When building a custom command set, define CONFIGURE_SHELL_COMMAND_SETENV to have this command included.

This command can be excluded from the shell command set by defining CONFIGURE_SHELL_NO_COMMAND_SETENV when all shell commands have been configured.

PROGRAMMING INFORMATION:

The setenv is implemented by a C language function which has the following prototype:

int rtems_shell_rtems_main_setenv(
  int    argc,
  char **argv
);

The configuration structure for the setenv has the following prototype:

extern rtems_shell_cmd_t rtems_shell_SETENV_Command;


PREV UP NEXT Bookshelf RTEMS Shell User's Guide

Copyright © 1988-2008 OAR Corporation