调用的bash,运行命令里面的新的外壳,然后给控制权交还给用户 [英] Invoke bash, run commands inside new shell, then give control back to user
问题描述
这必须是非常简单的,或非常复杂的,但我无法找到任何关于它...我试图打开一个新的bash的实例,然后运行它里面的一些命令,并给控制回用户的同样的实例中的
我试过:
$庆典-licsome_command
但执行 some_command
新的实例中,然后将其关闭。我希望它继续开放。
一个细节可能影响回答:如果我能得到这个工作,我会用它在我的的.bashrc
作为别名(ES),因此加分的别名
执行!
庆典--rcfile≤(回声〜/ .bashrc中; some_command')
免除临时文件的创建。在其他网站上的问题:
- http://serverfault.com/questions/368054/run-an-interactive-bash-subshell-with-initial-commands-without-returning-to-the
- http://unix.stackexchange.com/questions/123103/how-to-keep-bash-running-after-command-execution
This must either be really simple or really complex, but I couldn't find anything about it... I am trying to open a new bash instance, then run a few commands inside it, and give the control back to the user inside that same instance.
I tried:
$ bash -lic "some_command"
but this executes some_command
inside the new instance, then closes it. I want it to stay open.
One more detail which might affect answers: if I can get this to work I will use it in my .bashrc
as alias(es), so bonus points for an alias
implementation!
bash --rcfile <(echo '. ~/.bashrc; some_command')
dispenses the creation of temporary files. Question on other sites:
- http://serverfault.com/questions/368054/run-an-interactive-bash-subshell-with-initial-commands-without-returning-to-the
- http://unix.stackexchange.com/questions/123103/how-to-keep-bash-running-after-command-execution
这篇关于调用的bash,运行命令里面的新的外壳,然后给控制权交还给用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!