Starting interactive bash with an initial command
February 22, 2026
Suppose you want to spawn a new interactive shell and provide an initial command to run. But it should still behave as if you typed the command yourself. For demonstration purposes let’s assume the command you want is just vim. Turns out it’s not so easy. Bash doesn’t have a built-in option for that. You might try the following: vim; bash On the surface, it works; you exit vim, you get to the interactive shell.