examples: execute bash sessions in script environment
Previously, the sessions contained only explicitly exported variables and functions. This was fragile and in part buggy due to lacking exports. Interactive features like user-defined aliases and functions are still working as before.
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
# Start an interactive bash session in the current bash environment.
|
||||
|
||||
# BASH_ENVIRONMENT contains definitions of read-only variables like 'BASHOPTS' that
|
||||
# cause warnings on importing. Suppress these warnings during bash startup.
|
||||
BASH_ENVIRONMENT=<(declare -p; declare -pf) \
|
||||
bash --rcfile <(echo 'source $BASH_ENVIRONMENT 2>/dev/null')
|
||||
Reference in New Issue
Block a user