![]() |
bash: set <option> and sub-shells
With the following in mind:
Code:
#!/bin/bashVariables need to be explicitly exported to be recognized in a sub-shell, which makes me wonder if set -/+ X needs to be set in every sub-shell. Haven't been able to find this info in the bash man page. Thanks in advance! |
|
Quote:
|
I'm sure you already did a couple of tests and they revealed that shell options are not inherited from the parent shell. Indeed, this is not clearly mentioned anywhere. Maybe an explanation close to what really happens is given here: http://www.gnu.org/software/bash/man...on-Environment.
Shell options are cited in the list of the execution environment items, but not in the list of items inherited by a subshell. Maybe an indirect and somewhat obscure way to assert the evidence of the facts! :jawa: |
Quote:
Assuming that none are inherited is probably the smart thing to do. Better safe then sorry....... Quote:
|
untested#1:
Code:
#!/bin/bashCode:
#!/bin/bash |
| All times are GMT -5. The time now is 01:40 AM. |