You can set a variable for one command as follows:
MY_VARIABLE=my_value ./my_script.sh
You can pass another script as follows:
exec ./my_script.sh
But when I try to do this:
exec MY_VARIABLE=my_value ./my_script.sh
I get an error message:
exec: MY_VARIABLE=my_value: not found
Why is this? Is there any way to do this?
syntax bash exec
Ken
source share