Say I have a command that puts me into a subshell (e.g. nix-shell
). If I have a bash script that goes
enter-subshell
echo hi
the echo hi
will wait to be executed until I exit the subshell. Is there any way to write a script that behaves the same as manually typing out both lines in order? In other words, subsequent commands get executed in the newly invoked shell?
Edit: it seems what I'm looking to do doesn't have a general solution.
--run
option tonix-shell
?nix-shell --run "echo hi"