diff --git a/doc/man/man1/sbatch.1 b/doc/man/man1/sbatch.1 index 81441ee268f801486df08ecbc6d51f491aaa4fd9..8f846c7103042264f8370dbc620e84cb10541495 100644 --- a/doc/man/man1/sbatch.1 +++ b/doc/man/man1/sbatch.1 @@ -384,9 +384,9 @@ assumed. Export environment variables defined in <\fIfilename\fR> or read from <\fIfd\fR> to the job's execution environment. The content is one or more environment variable definitions of the form NAME=value, each separated by a null character. This allows the use -of special characters in environment definitions. The -\fB\-\-get\-user\-env\fR option will be ignored if \-\-export\-file is -defined. +of special characters in environment definitions.(Note: primarily for use +with Moab. outside of Moab, variables in the user's working environment +may supercede the variables specified in the file.) .TP \fB\-F\fR, \fB\-\-nodefile\fR=<\fInode file\fR> diff --git a/src/sbatch/sbatch.c b/src/sbatch/sbatch.c index 41a330be905a1c4de69d79b6405291abacd323ec..440a10a4a9a658b628f7640c2f7fabb6e3dd3301 100644 --- a/src/sbatch/sbatch.c +++ b/src/sbatch/sbatch.c @@ -393,8 +393,8 @@ static int _fill_job_desc_from_opts(job_desc_msg_t *desc) desc->environment = env_array_from_file(opt.export_file); if (desc->environment == NULL) exit(1); - opt.get_user_env_time = -1; - } else if (opt.export_env == NULL) { + } + if (opt.export_env == NULL) { env_array_merge(&desc->environment, (const char **)environ); } else if (!strcasecmp(opt.export_env, "ALL")) { env_array_merge(&desc->environment, (const char **)environ);