#ident "lib/libsc/cmd/env_cmd.c: $Revision: 1.31 $" /* * Commands that deal with the environment variables */ #include #include #include #include #include char *find_str(char *, struct string_list *); extern struct string_list environ_str; static char *readonly_errmsg = "Environment variable \"%s\" is" " informative only and cannot be changed.\n"; static char *nvram_errmsg = "Error writing \"%s\" to the non-volatile RAM.\n" "Variable \"%s\" is not saved in the permanent environment.\n"; /* * setenv_cmd -- set environment variables */ /*ARGSUSED*/ int setenv_cmd(int argc, char **argv, char **bunk1, struct cmd_table *bunk2) { int rval, override; char *var, *val; ULONG fd; /* * usage should be * setenv variable newvalue, or * setenv -f variable newvalue * setenv -p variable newvalue ("persistent" variable) * (not supported on all machines) */ #ifdef VERBOSE_XXX printf("setenv_cmd(%d,", argc); { int i; for (i=1; i 0) printenv(*++argv); return(0); }