mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-01-19 14:22:52 +08:00
parent
6775b0b1ad
commit
496d65fb5d
|
@ -1072,6 +1072,11 @@ bool exec_job(parser_t &parser, const shared_ptr<job_t> &j, const io_chain_t &bl
|
|||
return false;
|
||||
}
|
||||
|
||||
// Apply foo=bar variable assignments
|
||||
for (const auto &assignment : j->processes.front()->variable_assignments) {
|
||||
parser.vars().set(assignment.variable_name, ENV_LOCAL | ENV_EXPORT, assignment.values);
|
||||
}
|
||||
|
||||
internal_exec(parser.vars(), j.get(), block_io);
|
||||
// internal_exec only returns if it failed to set up redirections.
|
||||
// In case of an successful exec, this code is not reached.
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#RUN: %fish %s
|
||||
#RUN: %fish -C 'set -l fish %fish' %s
|
||||
|
||||
exec cat <nosuchfile
|
||||
#CHECKERR: warning: An error occurred while redirecting file 'nosuchfile'
|
||||
#CHECKERR: warning: Path 'nosuchfile' does not exist
|
||||
|
@ -10,7 +11,10 @@ not exec cat <nosuchfile
|
|||
echo "neg failed: $status"
|
||||
#CHECK: neg failed: 0
|
||||
|
||||
# See that variable overrides are applied to exec'd processes
|
||||
$fish --no-config -c 'foo=bar exec env' | grep foo=bar
|
||||
# CHECK: foo=bar
|
||||
|
||||
# This needs to be last, because it actually runs exec.
|
||||
exec cat </dev/null
|
||||
echo "not reached"
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user