diff --git a/examples/deploy-container.sh b/examples/deploy-container.sh index 5912ba5..d48dfb4 100755 --- a/examples/deploy-container.sh +++ b/examples/deploy-container.sh @@ -81,6 +81,6 @@ echo "Bitcoind data dir:" sudo ls -al /var/lib/containers/demo-node/var/lib/bitcoind # Uncomment to start a shell session here -# export -f c; bash -li +# . start-bash-session.sh # Cleanup happens at exit (see above) diff --git a/examples/deploy-nixops.sh b/examples/deploy-nixops.sh index b204aa9..d7209e8 100755 --- a/examples/deploy-nixops.sh +++ b/examples/deploy-nixops.sh @@ -39,6 +39,6 @@ nixops deploy -d bitcoin-node nixops ssh bitcoin-node systemctl status bitcoind # Uncomment to start a shell session here -# bash -li +# . start-bash-session.sh # Cleanup happens at exit (see above) diff --git a/examples/deploy-qemu-vm.sh b/examples/deploy-qemu-vm.sh index a87547c..01ad0df 100755 --- a/examples/deploy-qemu-vm.sh +++ b/examples/deploy-qemu-vm.sh @@ -91,6 +91,6 @@ echo "Node info:" c nodeinfo # Uncomment to start a shell session here -# export -f c; bash -li +# . start-bash-session.sh # Cleanup happens at exit (see above) diff --git a/examples/start-bash-session.sh b/examples/start-bash-session.sh new file mode 100644 index 0000000..6ed16bf --- /dev/null +++ b/examples/start-bash-session.sh @@ -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')